Selectores infinitos
4 azules diferentes, botones de 12 medidas diferentes.
Image by Brad Frost
Image by Brad Frost
Image by Brad Frost
Image by Brad Frost
Image by Brad Frost
Image by Brad Frost
Image by Jina Bolton
/*---------------tokens---------------*/
--color-gallery: #EBEBEB;
--color-mercury: #e5e5e5;
--color-wildsand: #F5F5F5;
/*---------------sizes---------------*/
--small: 5px;
--medium: 10px;
--large: 20px;
--xlarge: 40px;
--xxlarge: 60px;
--none: 0;
Code by Gorka Lauzirika & Beñat Espiña
"options and decisions aren’t buried in Sass files. Instead, they are centralized and propagated as tokens to any product, designer or developer adopting the system, in easy-to-use, predictable formats."
Así no:
body #container .someclass ul li {....}
Así sí:
.someclass {...}
Evitar los picos, y la tendencia general debería ser hacia una especificidad más alta al final de la hoja de estilo
/* Block component */
.btn {}
/* Element that depends upon the block */
.btn__price {}
/* Modifier that changes the style of the block */
.btn--orange {}
.btn--big {}
$9.99
Subscribe
"These problems are solved by BEM methodology, a development approach allowing to achieve flexible and maintainable code."
Common approach for all technologies: HTML, CSS, JavaScript, docs, tests, etc.
Image by BEM doc.
"Most projects use the same components. Code reuse significantly reduces price and time of development."
Image by BEM doc.
De menor concreción a mayor, creando un triángulo invertido.
Arriba los elementos generales, en la última capa, los concretos, específicos.
Object
.
o-object-name[
Component
.
c-component-name[
Utility
.
u-utility-name {}
Theme
.
t-theme-name {}
Scope
.
s-scope-name {}
State
.
[is|has]-state {}
Hack
.
_
Javascript
.
js-component-name {}
Quality Assurance
.
qa-node-name {}