I've moved on though, I learned flexbox and css grid and some atomic design principals as well as ABEM (https://css-tricks.com/abem-useful-adaptation-bem/) and I'm happy.
I've moved on though, I learned flexbox and css grid and some atomic design principals as well as ABEM (https://css-tricks.com/abem-useful-adaptation-bem/) and I'm happy.
And agreed: it's easiest to just work directly with flexbox (and grid if you can drop IE11), and a set of design principles is really valuable to avoid spaghetti.
[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/--*
[2]: https://drafts.csswg.org/css-nesting-1/
[3]: https://postcss.org/
My current shop is moving to switch our sass color function `color.get()` to either dump hardcoded hex or a css variable usage based on a param. It currently just does hex.
You might be happy to learn that CSS color module 4[1] will add `lab()` and `lch()` color definitions and CSS color module 5[2] will add the `color-adjust` function as well as other goodies.
Either 0 or 1 times. Use semantic classes `<a href="/path/to/create-stuff" class="button">` and use custom properties or the cascade from there:
:root {
--button-margin-block: 1ex;
--button-margin-inline: 1em;
}
dialog {
/*
* Modals buttons need more block space and
* less inline space.
*/
--button-margin-block: 1em;
--button-margin-inline: 1ex;
}
button,
.button {
margin-block: var(--button-margin-block);
margin-inline: var(--button-margin-inline);
}padding: p(‘s’) p(‘m’);
For that 8-px magic.
c for colors, bp for breakpoints, f for fonts etc.
This solves all the inconsistencies addressed by css frameworks and gives me slightly larger LEGO blocks.
Out of interest, that article goes out of its way to argue that the whole BEM format is changed to CamelCase, so that the atomic modifier can use "-".
Why wouldn't you just use the existing BEM component separator "__", and then nothing else need change.
The CamelCase version is prettier granted, but rather than an extra bit of information, it's a completely new format.