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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Julia Rechkunova
September 10, 2016
Programming
56
1
Share
BEM // Get Started // SASS Guidelines
Intro to BEM. SASS Guidelines.
Julia Rechkunova
September 10, 2016
Other Decks in Programming
See All in Programming
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
340
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
2
950
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
720
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
200
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
270
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
640
誰も頼んでない機能を出荷した話
zekutax
0
150
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
inferと仲良くなる10分間
ryokatsuse
1
270
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.2k
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
270
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
First, design no harm
axbom
PRO
2
1.2k
Designing for Performance
lara
611
70k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
The Curse of the Amulet
leimatthew05
1
12k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
540
Paper Plane (Part 1)
katiecoart
PRO
0
8k
Rails Girls Zürich Keynote
gr2m
96
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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