-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: label inheriting color if any parent element has color prop #20125
Comments
For anyone looking for a temp fix, here is a scss solution that will scope color inheritance to the item level for both md and ios.
|
Thanks for the issue. I can reproduce this behavior. Looks like the culprit is https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/label/label.ios.scss#L92-L94 (for MD mode as well). The slotted |
Thanks for the issue. This has been resolved via #23944, and a fix will be available in an upcoming release of Ionic Framework. |
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. |
#19711 Bug Report
Ionic version: 4.11.7
Current behavior:
<p>
tags insideion-labels
receive an override class to set theircolor: inherit
based on the existence of a parent element with the.ion-color
class. I assume this is to support setting thecolor
property of theion-label
orion-item
and having thep
tag adjust accordingly, which is fine - however the CSS selector used to target this behaviour is a bit loose and causes thecolor: inherit
property to be applied if ANY parent element has acolor
attribute set.This doesn't seem like the intended behaviour. For example, if I set
color="light"
on myion-content
element in order to adjust the background colour of my content, any nestedion-labels
will have theirp
tags adjusted - even if I intended to have the "default" styling on the list, item, and label elements.Expected behavior:
I would think that the intended behaviour would be to limit the scope of the CSS selector to just parent
ion-labels
orion-items
?Steps to reproduce:
See related code. I've created two tabs - one showing current behaviour and the other with it's component scss adjusted to illustrate expected behaviour.
Related code:
https://stackblitz.com/edit/ionic-v4-angular-tabs-gqkmdr
The text was updated successfully, but these errors were encountered: