5 ms·
> 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 */ } I
by 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.