&.something scss syntax breaks styles
See original GitHub issueEnvironment
Latest Nuxt 3 and windicss, see reproduction…
Reproduction
https://stackblitz.com/edit/nuxt3-windi-css-bug
Describe the bug
The following scss
syntax broke somewhere between version 3.0.0-27424151.dbab979
and the latest version 3.0.0-27451165.114cbe3
.repo-list-item {
@apply p-4 bg-white dark:bg-gray-800 md:(shadow-lg rounded-lg);
&.status-0 {
.indicator {
@apply border-gray-300 dark:border-gray-600;
}
}
}
What happens is that once &.something...
is added the styles for .repo-list-item
under @apply p-4 ...
are no longer added. Note that this is windicss.
Additional context
The version where it still works had a bug and required components: { global: true }
, maybe the fix for that created the problem, but just a wild guess…
Update
The following also doesn’t work:
.repo-list-item {
@apply p-4 bg-white dark:bg-gray-800 md:(shadow-lg rounded-lg);
.indicator {
@apply border-gray-300 dark:border-gray-600;
}
}
It seems like nested @apply
s break the ones on the top-level selector.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
word-break - CSS: Cascading Style Sheets - MDN Web Docs
The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box.
Read more >Style Rules - Sass
Style rules are the foundation of Sass, just like they are for CSS. And they work the same way: you choose which elements...
Read more >css - What would cause a sass file to break compilation due to ...
Have you tried deleting the line and re-typing it (not cut/paste style)? · Sounds like you're compiling indented SASS and not SCSS. ·...
Read more >CSS word-break property - W3Schools
Default value: normal. Inherited: yes. Animatable: no. Read about animatable. Version: CSS3. JavaScript syntax: object.style.wordBreak="break-all" Try it ...
Read more >CSS Basics: The Syntax That Matters & The Syntax That Doesn't
If you miss the opening brace, CSS will keep reading as if the next bit of text is still part of the selector....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks so much @danielroe 🙏🏽
@danielroe I managed to reproduce.
3.0.0-27451165.114cbe3
broken: https://stackblitz.com/edit/nuxt3-windi-css-bug3.0.0-27424151.dbab979
working: https://stackblitz.com/edit/nuxt3-windi-css-bug-part-2Everything but the nuxt version is the same.
If I should still raise it in nuxt-windicss please let me know 🙏🏽