Hacker News new | ask | show | jobs
by shikwasa 64 days ago
I understand the "starting point" part but I find the emphasis on "classless" interesting: you basically have to introduce a non-element selector as soon as you want make even the smallest layout change.

For anything beyond a single page document, I find something like matcha.css (https://matcha.mizu.sh, you can even pick your custom build on the same page) a practical starting point if you want to stay close to the elements.

2 comments

I tend to start a project by making a classless stylesheet of sorts to set a baseline for the theme and branding.

Its almost never all you need for an actual project, but it is a nice starting point to get the basics in place.

I find that I look at the endless list of classless stylesheets shared online as a starting point, most have at least one or two interesting tricks worth borrowing. I don't find using the off the shelf ones particularly useful though, it ends up with a very generic look to it like the old default bootstrap site or newer default tailwind site.

With @layer this has become simpler:

    /* define layer order. Not necessary here */
    @layer pico, nils;

    /* import framework into layer */
    @import url("pico.css") layer(pico);

    /* define own styles in own layer, they have precedence. CSS vars are still global. */
    @layer nils {
        p:first-of-type {
            color: green;
        }
    }