Varya Stepanova, SC5 Online
This is not hard in CSS | This is! |
---|---|
|
|
How do we architect encapsulated components?
.BLOCK{__ELEMENT[--MODIFIER]}
<button class="button">Button button</button>
<span class="button">Span button</span>
<a class="button" href="#">Link button</a>
Span button Link button
<button class="button">Button</button>
<button class="button button--selected">
Selected button</button>
$element.addClass('button--selected')
<button class="button">Button</button>
<button class="button button--brand">Brand button</button>
<button class="button button--brand button--selected">
Selected brand button</button>
<button class="button">Button</button>
<button class="button button--night">Night button</button>
<button class="button button--night button--selected">
Selected night button</button>
<button class="button button--process">
Doing smth button</button>
$element.toggleClass('button--process')
// Sugar: $element.toggleMod('process')
<button class="button button--brand button--process">
Doing smth brand button</button>
<div class="input">
<input class="input__field">
<span class="input__keyboard"></span>
</div>
<ul class="menu">
<li class="menu__item">Item 1</li>
<li class="menu__item">Item 2</li>
<li class="menu__item">Item 3</li>
</ul>
<ul class="menu">
<li class="menu__item">
<a class="menu__link">Item 1</a>
</li>
...
</ul>
menu__item__link
!<ul class="menu">
<li class="menu__item">Item 1</li>
<li class="menu__item menu__item--current">Item 2</li>
<li class="menu__item">Item 3</li>
</ul>
#id
but .class
|
|
$text__family-sans: "Proxima Nova", Helvetica, sans-serif;
$text__size--beta: 30;
$text__line--beta: 36;
$text__colour--base: $color__neutral--dark;
$text__colour--alpha: $color__primary;
$text__colour--beta: $color__primary;
components/
header.sass
footer.sass
menu.sass
...
components/
header/
header.ctrl.js
header.dir.js
header.html
header.sass
footer/
...
logo/
logo.sass
logo.svg
auth-form/
auth-form.sass
auth-form__background.gif
auth-form.ctrl.js