Replies: 4 comments 1 reply
-
Some additional details on "output is not what I expect". I'd like a way to disable the warning, as there shouldn't be warnings in my build if everything works ok. Using /* Input */
.outer {
.nested {
@apply text-red-400 bg-black
}
}
/* Actual output */
.outer {
.nested {
/* Inline text-red-400 */
}
.nested {
/* Inline bg-black */
}
}
/* Expected output */
.outer {
.nested {
/* Inline text-red-400 */
/* Inline bg-black */
}
} |
Beta Was this translation helpful? Give feedback.
-
Now that nesting is a feature of CSS it would be great to be able to disable the warning. Example usecase: In this instance it's not possible to apply classes to all the elements on the page; they'll be generated along the way by some markdown parser, so you need to write some CSS to apply rules to the blog post. A convenient way to do this would be to have one CSS file (say, posts.css) with a single class (say, e.g. .post-wrapper {
p {
margin-bottom: 1rem;
}
blockquote {
border-left: 3px solid black;
}
// other rules
} In this instance I'm reluctant to install PostCSS just to handle one relatively small file in the project. |
Beta Was this translation helpful? Give feedback.
-
The CSS Nesting module allows you to write your stylesheets so that they are easier to read, more modular, and more maintainable. |
Beta Was this translation helpful? Give feedback.
-
Native CSS nesting support is in the latest TailwindCSS release, see #13317 . However, it doesn't include |
Beta Was this translation helpful? Give feedback.
-
Nesting of CSS rules is becoming supported in all browsers:
https://caniuse.com/css-nesting
Is there a way to use it with Tailwind (or is it coming in a future releast)?
The current docs only mention how to set up the PostCSS plugin.
Everything works fine with the plugin, but I'm always happy if I can drop NPM dependencies and get smaller outputs!
Beta Was this translation helpful? Give feedback.
All reactions