SlideShare a Scribd company logo
1 of 22
Download to read offline
BEM Methodology
Jacek Spławski
Poznań, January 2016
We are not designing pages, we are
designing systems of components.
— Stephen Hay
Modularity is requirement of maintainable
systems.
— Ben Callahan
OOCSS / SMACSS / BEM / Atomic / SUITCSS
BEM is a naming convention for classes in
HTML and CSS.
Created by Yandex — one of the leading
internet companies in Russia.
Block Element Modifier
Block is standalone entity that is
meaningful on its own.
Blocks can be nested and interact with each
other, semantically they remain equal;
there is no precedence or hierarchy.
Block names may consist of lowercase
Latin letters, digits, and dashes. Individual
words within names are separated by a
dash.
.block
Block name should identify block and say
what it is responsible for. The block name
replaces IDs.
Element is parts of a block and have no
standalone meaning. They are
semantically tied to its block.
Element names may consist of Latin
letters, digits, dashes and underscores.
CSS class is formed as block name plus
two underscores plus element name.
.block__element
Modifier are flags on blocks or elements.
Use them to change appearance or
behavior.
Modifier names may consist of Latin
letters, digits, dashes and underscores.
CSS class is formed as block’s or
element’s name plus two dashes.
.block__element——modifier
DOM Tree → BEM Tree
Sass ♥ BEM
.block {
&——modifier {}
&__element {}
}
=
.block {}
.block——modifier {}
.block__element {}
BEM ? JS
jQuery BEM Helpers jQuery BEM Plugin
i-BEM framework by Yandex
no dependencies on other elements
reduce cascading problems reduce
amount of CSS code create ready blocks
library simple and understandable
structure in CSS and HTML code Sass
loves BEM drop tag names and IDs
long class names which could look’s
weird develop the habit to properly name
class modular thinking
https://css-tricks.com/bem-101/
http://getbem.com/
https://en.bem.info/
https://www.smashingmagazine.com/
2012/04/a-new-front-end-methodology-
bem/

More Related Content

What's hot (6)

Html frames
Html framesHtml frames
Html frames
 
OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?
 
Html web designing enhancing text
Html web designing enhancing textHtml web designing enhancing text
Html web designing enhancing text
 
Html text formatting
Html text formattingHtml text formatting
Html text formatting
 
How to create a html webpage using notepad
How to create a html webpage using notepadHow to create a html webpage using notepad
How to create a html webpage using notepad
 
Css
CssCss
Css
 

Similar to Introduction to BEM Methodology (7)

BEM methodology overview
BEM methodology overviewBEM methodology overview
BEM methodology overview
 
BEM
BEMBEM
BEM
 
The Cascade is Dead
The Cascade is DeadThe Cascade is Dead
The Cascade is Dead
 
OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM, what is the question...
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan Rosu
 
Workshop SASS for BEM development
Workshop SASS for BEM developmentWorkshop SASS for BEM development
Workshop SASS for BEM development
 
Rock Solid CSS Architecture
Rock Solid CSS ArchitectureRock Solid CSS Architecture
Rock Solid CSS Architecture
 

More from Merixstudio

More from Merixstudio (7)

Jak przeżyć "kreatywne" warsztaty online i nie zwariować
Jak przeżyć "kreatywne" warsztaty online i nie zwariowaćJak przeżyć "kreatywne" warsztaty online i nie zwariować
Jak przeżyć "kreatywne" warsztaty online i nie zwariować
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
gamifikacja
gamifikacjagamifikacja
gamifikacja
 
Design Thinking 101
Design Thinking 101Design Thinking 101
Design Thinking 101
 
Magento - wprowadzenie
Magento - wprowadzenieMagento - wprowadzenie
Magento - wprowadzenie
 
Responsive Web Design: why is it so crucial?
Responsive Web Design: why is it so crucial?Responsive Web Design: why is it so crucial?
Responsive Web Design: why is it so crucial?
 
Merixstudio: about us
Merixstudio: about usMerixstudio: about us
Merixstudio: about us
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Introduction to BEM Methodology