Can we avoid using ':' to replace '-'? #43310
Replies: 4 comments 5 replies
|
I think the colon syntax has an intuitive if-then feel. For example, But this will definitely be the most widespread breaking change to trawl through and fix, and I kind of dread the migration process for that reason. |
|
Absolutely necessary, solves a bug and creates a clear separation of concerns. Let's say you want different shadows on different breakpoints. I want smaller shadows on larger screens, and larger shadows on smaller screens. Historically, the breakpoint goes in the middle. So you'd be using Not only that it is super hard to read, but the bigger issue, since So you have 2 classes overriding eachother.
but
With the new syntax, this bug has been resolved. Furthermore, it also allows for some additional functionality, as described in the Utility API section. For example, we now have dark mode selectors. E.g: Without the new syntax, you'd be having It is better in every way compared to the old one and fixes a long standing issues that developers had. |
|
Hello there! Personally, I agree with the new syntax; I think it is easier to be read and understand, but I want to ask something if you please. Using the below classes, I expected that the border color changes depending on the breakpoints: <div class="border sm:border-primary md:border-danger lg:border-accent">
</div>... However, nothing happened... in fact no color is applied, only the "border" class is apparently taking in count. I am doing something wrong? I am missing something? Maybe these "breakpoints" are only available for certain classes and not all of them? Thanks in advance! |
|
Thanks for your fast reply, @pricop! I will take a look! Thanks again! 👍 |
Uh oh!
There was an error while loading. Please reload this page.
Is it really necessary to change the class name format?
The "lowercase letters with hyphens" combination is correct, so it feels like there's no need to take a different approach.
All reactions