Open stefanv opened 4 weeks ago
are they expected to behave differently at runtime, or only going to matter for things like readability of the compiled CSS file and/or webpack's ability to minimize file size?
Looking at the page you linked, I can see that the compiled CSS looks a bit different, but I'd expect them to behave the same way. I know later declarations can override earlier ones, but in this case .example a
has greater specificity than .example
so I'm not clear what difference it would make. Or is my understanding of CSS cascades simply wrong/incomplete?
I agree, their example doesn't illustrate any particular problem, as far as I can tell. Let me investigate a bit more; I presume they wouldn't publish it as a deprecation if it didn't have an impact.
I can't come up with an example right now, so I asked on the original dart-sass issue: https://github.com/sass/dart-sass/pull/2267#issuecomment-2290073546
Thanks @stefanv - per their docs and warning this seems like a breaking change but like @drammock mentioned I do not see a clear difference if overrides hierarchy remain the same. Will note this issue as needing more information since you already pinged folks in dart-sass
They provided an example today:
.example {
color: red;
@media screen {
font-weight: bold;
}
font-weight: normal;
}
When compiling the style files from PDST using dart-sass, it emits warnings related to changes is how SASS will deal in the future with mixed declarations.
Short story, before a declaration like:
Would pull
font-weight
to the top of.example
, and definea font-weight
after. Now, they leave the ordering alone.At least the following cases are present in PDST:
The workaround? As Dart Sass reports: