-
Notifications
You must be signed in to change notification settings - Fork 486
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
@clayui/css: Buttons increase specificity of .btn:disabled #5469
Comments
There is another option, but I'm not sure you'll like it... 😉
This way specificity and order is set once and new variants only override what they are concerned with. |
@ethib137 I'm not totally against this other than the breaking changes part. It still runs into the same problem where we need to declare the disabled colors on |
Hey @pat270 Yeah, I think this would solve the problem of having to redeclare the disabled colors for the variants. Check out this code pen example: https://codepen.io/ethib137/pen/zYmqzqV. Additionally I don't think this would have to be a breaking change. We could still use the existing sass maps to generate the type of markup I'm writing in the codepen. Since the sass maps are our api it woudn't need to be a breaking change, right? |
@ethib137 Thanks for the example, that would indeed work. The underlying CSS is being changed, but I don't think it would affect people overwriting our components via a separate CSS file. It just adds some extra custom properties for users using it the traditional way. I think I need to try and see if it would break some existing themes before committing. If we do decide to do this, how do we communicate we are making this change? If we decide here then we would have to commit to the whole project. |
Yeah, it would be important to communicate, since one of the benefits of this is it would make it easier to override our css since it would reduce the specificity needed of our selectors. This is also a danger since it could result in some styles being overridden by custom themes that the dev did not intend. Is this a change we would have to wait for a major version to move to?
|
LPS Ticket: https://liferay.atlassian.net/browse/LPS-190183 |
If there is a single
.btn:disabled
state, we need to apply the styles to every variant due to.btn:disabled
being declared before the variants like.btn-primary
. It makes it difficult to apply the disabled state since we need to apply it on every variant or else states like.btn-primary:hover
will win when hovering over a disabled button.We can increase specificity directly in the
.btn:disabled
selector or we can declare the selector later in the file after the variants.The text was updated successfully, but these errors were encountered: