// syntax: [<namespace>-]<ComponentName>[.is-stateOfComponent][-descendentName][--modifierName]
<button class="Button Button--modifier is-active ButtonSimple Box Box--modifier">
<span class="Button-icon"></span>
<span>
<span>
<span class="Button-deepVeryLongDescentName"></span>
</span>
</span>
</button>
// Compor múltiplos componentes: class="Button ButtonSimple Box"/* Syntax: --ComponentName[-descendant|--modifier][-onState]-(cssProperty|variableName) */
--Button-color
--Button-backgroundColor
--Button-onHover-color
--Button-deepVeryLongDescentName-color
--Button-deepVeryLongDescentName-onHover-colorEm vez disso, utilize o id ou o atributo do js para acessar o DOM. Para que o refatoração da IU não quebre as características do Javascript.
<div class="ButtonAdd" id="button-add" js="ButtonAdd">
document.querySelector('.ButtonAdd') // ❌
document.querySelector('#button-add') // ✔️
document.querySelectorAll('js[ButtonAdd]') // ✔️- Deve estar em formato svg.
- Deve ter
<svg class="icon" width=".." height=".." viewBox=".."> - Cor personalizada:
<path fill="currentColor">
// src/icons/flag/hello.svg
<svg class="icon" width="24" height="24" viewBox="0 0 24 24">
<path stroke="currentColor"></path>
</svg>// hello.php
<?= icon('flag/hello') ?>