Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
BEM - Los problemas de CSS y cómo se pueden ali...
Search
Guillermo Moreno
February 23, 2017
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BEM - Los problemas de CSS y cómo se pueden aliviar
Presentación para Platanus en Febrero 2017
Guillermo Moreno
February 23, 2017
More Decks by Guillermo Moreno
See All by Guillermo Moreno
Desarrollo Móvil en Javascript: Cordova y React Native
gmq
0
130
Other Decks in Programming
See All in Programming
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
110
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
220
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
mrbgem 三角測量 開発
ogom
0
170
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
290
setup-vp GitLab対応の裏側
naokihaba
0
140
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
470
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.3k
速習iPhone Duo対応
yuukiw00w
2
920
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.6k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
Google's AI Overviews - The New Search
badams
0
1.6k
The Invisible Side of Design
smashingmag
301
52k
Un-Boring Meetings
codingconduct
0
440
A designer walks into a library…
pauljervisheath
211
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
520
Transcript
BEM BLOCK ELEMENT MODIFIER AKA: LOS PROBLEMAS DE CSS Y
CÓMO SE PUEDEN ALIVIAR
<div class="sidebar"> <h2>Secciones</h2> <ul> <li>Home</li> <li>Contacto</li> </ul> <h2>Sponsors</h2> <ul> <li>Platanus</li>
<li>Google</li> </ul> </div> .sidebar h2 { font-size: 1em; color: red; } .sidebar ul { list-style: none; } .sidebar ul li { font-size: .8em; } ¿PROBLEMAS EN CSS?
Secciones Home Contacto Sponsors Platanus Google
<div class="sidebar"> <h2>Secciones</h2> <ul> <li>Home</li> <li>Contacto</li> </ul> <h2 class="sponsors">Sponsors</h2> <ul
class="sponsors"> <li id="platanus">Platanus</li> <li>Google</li> </ul> </div> .sidebar h2 { font-size: 1em; color: red; } .sidebar ul { list-style: none; } .sidebar ul li { font-size: .8em; } .sidebar h2.sponsors { color: blue; } #platanus { color: yellow; text-decoration: underline; }
Secciones Home Contacto Sponsors Platanus Google
<div class="sidebar"> <h2>Secciones</h2> <ul> <li>Home</li> <li>Contacto</li> </ul> <h2 class="sponsors">Sponsors</h2> <ol
class="sponsors"> <li id="platanus">Platanus</li> <li>Google</li> </ol> </div>
Secciones Home Contacto Sponsors 1. Platanus 2. Google
ol { color: pink; } /* --- */ .sidebar h2
{ font-size: 1em; color: red; } .sidebar ul { list-style: none; } .sidebar ul li { font-size: .8em; } .sidebar h2.sponsors { color: blue; } #platanus {
<div class="sidebar"> <h2>Secciones</h2> <ul class="secciones"> <li>Home</li> <li id="platanus">Platanus</li> <li>Contacto</li> </ul>
<h2 class="sponsors">Sponsors</h2> <ol class="sponsors"> <li id="platanus">Platanus</li> <li>Google</li> </ol> </div> /* ... */ #platanus { color: yellow; text-decoration: underline; } .secciones * { text-decoration: none; }
Secciones Home Platanus Contacto Sponsors 1. Platanus 2. Google
Especi cidad. #platanus es mucho más especi co que .secciones
Fragilidad. el cambio de ul a ol rompió código que no debería haber roto Poco modular. El estilo de ol de otra parte de la página cambió el estilo de nuestra PROBLEMAS
BEM BLOCK * ELEMENT * MODIFIER
UN COMPONENTE O ENTIDAD QUE TIENE SIGNIFICADO POR SI MISMO
Y ES INDEPENDIENTE DEL RESTO BLOCK
PARTES DE UN BLOQUE QUE NO TIENEN SIGNIFICADO FUERA DE
ÉL. NOMBRE DE LA SECCIÓN + DOS GUIONES BAJOS. .sidebar__titulo .sidebar-section__link .btn__icon ELEMENT
IDENTIFICA CAMBIOS DE APARIENCIA O COMPORTAMIENTO EN UN ELEMENTO O
BLOQUE. NOMBRE DEL BLOQUE O ELEMENTO + DOS GUIONES. .sidebar__titulo--primary .sidebar-section__link--platanus MODIFIER
.sidebar__title { font-size: 1em; color: red; } .sidebar__list { list-style:
none; } .sidebar__item { font-size: .8em; } .sidebar__item--underline { text-decoration: underline; } .sidebar__title--sponsors { color: blue; } .sidebar__item--platanus { color: yellow; <div class="sidebar"> <h2 class="sidebar__title">Secciones</ <ul class="sidebar__list"> <li class="sidebar__item">Home</li> <li class="sidebar__item sidebar__item--platanus <li class="sidebar__item">Contacto</ </ul> <h2 class="sidebar__title--sponsors"> <ol> <li class=" sidebar__item sidebar__item--platanus sidebar__item--underline ">Platanus</li> <li class="sidebar__item">Google</li </ol> </div>