Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
BEM // Get Started // SASS Guidelines
Search
Julia Rechkunova
September 10, 2016
Programming
1
50
BEM // Get Started // SASS Guidelines
Intro to BEM. SASS Guidelines.
Julia Rechkunova
September 10, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
AI Agents: How Do They Work and How to Build Them @ Shift 2025
slobodan
0
100
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
270
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
2
770
RDoc meets YARD
okuramasafumi
4
170
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
540
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.5k
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
540
testingを眺める
matumoto
1
140
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
610
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
130
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
Ruby Parser progress report 2025
yui_knk
1
460
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
The Language of Interfaces
destraynor
161
25k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Music & Morning Musume
bryan
46
6.8k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Being A Developer After 40
akosma
90
590k
How GitHub (no longer) Works
holman
315
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Transcript
BEM Get Started SASS Guidelines @jughosta
BEM • Block • Element • Modifier More info https://en.bem.info/methodology/
BEM // Block <section class="search"> ... </section>
BEM // Element <section class="search"> <div class="search__content"> ... </div> ...
</section>
BEM // Element <section class="search"> <div class="search__content"> ... </div> <input
type="text" class="search__input"> </section>
BEM // Element <section class="search"> <div class="search__content"> <input type="text" class="?">
</div> ... </section>
BEM // Element <section class="search"> <div class="search__content"> <input type="text" class="search__input">
</div> ... </section>
BEM // Block inside Element <section class="search"> <div class="search__content"> <input
type="text" class="search__input"> <button class="button">Search</button> </div> ... </section>
BEM // Element for additional styles (margins, ...) <section class="search">
<div class="search__content"> <input type="text" class="search__input"> <button class="button" style="margin-left: 30px">Search</button> </div> ... </section>
BEM // Element for additional styles (margins, ...) <section class="search">
<div class="search__content"> <input type="text" class="search__input"> <div class="search__button"> <button class="button">Search</button> </div> </div> </section>
BEM // Modifier <section class="search"> <div class="search__content"> <input type="text" class="search__input">
<div class="search__button"> <button class="button button--small">Search</button> </div> </div> </section>
BEM // Modifier name + value <section class="search"> <div class="search__content">
<input type="text" class="search__input"> <div class="search__button"> <button class="button button--size-small">Search</button> </div> </div> </section>
BEM with CSS Block .block { … } Element .block__element
{ … } Modifier .block--modifier { … } .block__element--modifier { … }
BEM with SASS .block { &--modifier { … } }
.block__element { … } // searchable
BEM with SASS .block { &--modifier { … } }
.block__element { … } @include media($mq) { … // same structure here }
BEM with SASS .block { ... &:hover { … }
&:before { … } &--modifier { … } } .block__element { … } .block__long-element-name-here { … }
SASS Code Style • Always use .class selectors • No
#id as a selector • No tag as a selector • Max 2 levels for nesting • .util-text-overflow-break • .layout-page • 0, not 0px • #ccc, not #cccccc or #CCC • … More info https://sass-guidelin.es/
CSS properties order .selector { /* Positioning */ /* Display
& Box Model */ /* Color */ /* Text */ /* Other */ } More info https://css-tricks.com/poll-results-how-do-you-order-your-css-properties/
Thanks Q&A