Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(segment): adds global variables for targeting segment in toolbar #16344

Merged
merged 2 commits into from
Nov 16, 2018

Conversation

brandyscarney
Copy link
Member

Short description of what this resolves:

Currently the segment does not use the available toolbar color variables:

--ion-toolbar-color
--ion-toolbar-color-activated

I could have made it use these but then we run into the problem of not being able to customize only the segment buttons (separate from the text or buttons) when they're unchecked or checked. For example, in order to recreate the following:

image

We would need to be able to pass an opacity to the unchecked color. Without the user specifying the opacity or passing an rgb, we can't manipulate only the single color. So basically we needed to add another variable in order to keep the buttons in a toolbar one color #ffffff and the unchecked segment buttons another color rgba(255, 255, 255, .6). Thus I have added the following CSS globals to customize segment further:

--ion-toolbar-color-unchecked
--ion-toolbar-color-checked

Granted --ion-toolbar-color-checked could be left out, and we could just use the value of --ion-toolbar-color, but since our defaults set checked to the primary color I figure we should offer full control.

@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Nov 16, 2018
@brandyscarney brandyscarney changed the title fix(segment): adds global variable for targeting segment in toolbar fix(segment): adds global variables for targeting segment in toolbar Nov 16, 2018
@brandyscarney brandyscarney merged commit 10971cc into master Nov 16, 2018
@brandyscarney brandyscarney deleted the fix-segment-theming branch November 16, 2018 18:19
brandyscarney added a commit to ionic-team/ionic-docs that referenced this pull request Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant