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と”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
180
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
15
5.3k
Rails Frontend Evolution: It Was a Setup All Along
skryukov
0
250
おやつのお供はお決まりですか?@WWDC25 Recap -Japan-\(region).swift
shingangan
0
140
技術同人誌をMCP Serverにしてみた
74th
1
680
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
270
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
710
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
900
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
170
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
330
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1.1k
Deep Dive into ~/.claude/projects
hiragram
14
11k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
BBQ
matthewcrist
89
9.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Adopting Sorbet at Scale
ufuk
77
9.5k
How GitHub (no longer) Works
holman
314
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
108
19k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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