-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: no way to set color for <ion-input label> - request for @labelColor #27326
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
Comments
Thanks for the report. You can set the label color already in Ionic: https://codepen.io/liamdebeasi/pen/mdzwNJa Is there something that is not working on your end? |
@liamdebeasi this would work. I just have not found this way in documentation. Is .label-text class documented anywhere? I also kinda liked the way to set colors through ionic's color attribute but I can live with a custom class. I'll give it a try over the weekend. |
The internal structure of our components are not documented currently, but you can interact with As for components where you pass the label text directly inside of the component (i.e. checkbox, toggle, radio, etc) you can definitely continue to use <!-- Not Recommended -->
<ion-label color="danger">My Label</ion-label>
<ion-radio></ion-radio>
<!-- Recommended -->
<ion-radio>
<ion-label color="danger">My Label</ion-label>
</ion-radio> |
The warning says should not be used at all:
If we still can use Can I also pass ion-label inside |
Yeah that warning is a bit confusing. I'll look into clarifying that.
Not at the moment. See #27061. |
Liam, below worked for me:
But I wonder how to account for themes (dark/light)? Below does NOT work for me.
Previously |
Is |
You right, the variables file was not added to the app I've tested. The |
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. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
Looks like the new implementation is a regression and we lose ability to customize label styling.
With new way of setting labels for inputs (ion-input, ion-select, etc) there is seems no way to set color for labels.
Previously:
Now
Expected Behavior
I believe an attribute
labelColor
should be provided to customize label.This should be applied for all inputs that take label (ion-input, ion-select, ion-radio, etc)
Steps to Reproduce
Simply check new label vs old with color.
Code Reproduction URL
No response
Ionic Info
I'm using NX so for some reason
ionic info
is not very informative:Additional Information
It would be good to know what is the reason for the change.
The text was updated successfully, but these errors were encountered: