You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
Running, when the icon is the color defined by the ion-toolbar's color variable. If I run this in Ionic Lab, the iOS version of the icon is the default primary color, while the Android version uses my overrides.
Expected behavior:
Not sure which might be right, just have the platforms do the same thing.
Steps to reproduce:
define two CSS Variables in variabled.scss
<ion-buttons slot="secondary">
<ion-button fill="outline">
<ion-icon slot="start" name="star"></ion-icon>
Star
</ion-button>
</ion-buttons>
Related code:
run this code to update the variables
document.documentElement.style.setProperty(--mycolor, '#ccc');
document.documentElement.style.setProperty(--mytextcolor, '#000');
You can see that the problem you're running into is that the iOS buttons use the primary color by default, but the title is black. Material Design uses whatever the toolbar color is for both the title and buttons.
The component-level CSS variables should be set on the components themselves and used more on a per-component basis. If the component has --color set, it won't inherit --color from its parent, that's just how CSS variables work. I think if you're trying to change global themes, you should use the provided theme variables which work a bit differently than trying to override component by component. There is some documentation on the themes here: https://ionicframework.com/docs/theming/advanced#themes
However, in testing this out I realized iOS wasn't theming the toolbar properly using our global toolbar variables, so I updated the PR to fix this now: #18191
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
brandyscarney commentedon May 2, 2019
Thanks for the issue! Could you paste the full markup for the header? The toolbar is setting
color?chrisgriffith commentedon May 2, 2019
and the methods
brandyscarney commentedon May 2, 2019
Thanks! I was able to reproduce it in this Codepen: https://codepen.io/brandyscarney/pen/VNoPNj?editors=1000
I think I have found the issue as well.
fix(buttons): inherit toolbar color for default iOS buttons
chrisgriffith commentedon May 2, 2019
brandyscarney commentedon May 10, 2019
Actually, in revisiting this, I don't think it is possible to work like that. I created a simple Codepen showing this behavior with normal divs: https://codepen.io/brandyscarney/pen/BeKGyZ
You can see that the problem you're running into is that the iOS buttons use the primary color by default, but the title is black. Material Design uses whatever the toolbar color is for both the title and buttons.
The component-level CSS variables should be set on the components themselves and used more on a per-component basis. If the component has
--colorset, it won't inherit--colorfrom its parent, that's just how CSS variables work. I think if you're trying to change global themes, you should use the provided theme variables which work a bit differently than trying to override component by component. There is some documentation on the themes here: https://ionicframework.com/docs/theming/advanced#themesI think the solution is something like this: https://codepen.io/brandyscarney/pen/BeKvaq?editors=0110
However, in testing this out I realized iOS wasn't theming the toolbar properly using our global toolbar variables, so I updated the PR to fix this now: #18191
Let me know if you have any concerns with this!
chrisgriffith commentedon May 10, 2019
Makes sense to me. Glad you found that other issue. Should I close this out?
brandyscarney commentedon May 13, 2019
@chrisgriffith No I will close this with that fix, thank you!!
fix(buttons): use theme/color toolbar colors for buttons (#18191)
merge release-4.4.1
ionitron-bot commentedon Jun 13, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.