chrisblakley/Nebula

Watch for CSS when/else conditionals [🟥 awaiting full support]

chrisblakley opened this issue · 0 comments

Allows for conditional rules to be used within native CSS.

Simple example:

.container {
    width: 80%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 1rem;
    @when element(max-width: 400px) {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
}

https://caniuse.com/css-when-else

Screen Shot 2023-09-19 at 5 26 25 PM