3 ms·
> How many times do you really need to style button/link and write out your 8px margins. Either 0 or 1 times. Use semantic classes `<a href="/path/to/create-st
by runarberg 6y ago
> How many times do you really need to style button/link and write out your 8px margins.
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);
}
- notJim 6y agoYup, classes are the way to go.