3 ms·
> Styling. The problem I found is that my full-SSR project doesn't use any Node.js at all, and it works fine for everything but CSS, because in order to use in
by deepsun 1y ago
> Styling.
The problem I found is that my full-SSR project doesn't use any Node.js at all, and it works fine for everything but CSS, because in order to use includes and variables I need a CSS compiler.
For example, I use a CSS library that defines a very nice style class "alib-link" for all links. I would want to set it for all <a> elements, without adding `class="alib-link"` all the time. It's easy with a CSS-preprocrssor, but how to avoid using one?
- alwillis 1y ago> I would want to set it for all <a> elements, without adding `class="alib-link"` all the time. a { /* the code from the alib-link class */ } If you need to style anchor links depending on where they point to, you could use an attribute selector: a[href*="news.ycombinator.com"] { /* more css */ } No preprocessing necessary.
- deepsun 1y agoYes, that's what I do currently. But that css lib has way more useful styles, it's hard to copy everything (e.g. :hover, :visited, @media etc). They also release new versions, fixes from time to time. Would be great if CSS had a feature "bind all styles from that selector to this selector". Or if browsers understood SCSS, it allows that and much more.