SlideShare a Scribd company logo
BEM methodology overview
_by Oleksii Prohonnyi
DEFINITION
BEM (stands for Block, Element, Modifier)
It's a way of describing reality in code, a
range of patterns, and a way of thinking
about program entities regardless of
programming languages being used.
<bem.info>
HISTORY
From 2005
CSS classes for blocks got prefixes (b-, c-,
g-) to provide sort of a namespace
emulation in CSS.
Independent Block concept
was the basis of Yandex HTML layouts, was
featured at the ClientSide'2007 conference
in Moscow, Russia.
Absolutely Independept Block (AIB)
 Only classnames (not IDs) should be used to describe styles.
 Each block classname has a prefix.
 Any CSS rules except ones prefixed with g- must belong to a
block.
 Compound blocks were allowed (or sometimes, required) to have
nested blocks embedded.
 never match CSS to tagnames, use classnames for everything:
.b-user b -> .b-user .first-letter
 classnames for block elements must be prefixed with the parent
block name: .b-user .first-letter -> .b-user-first_letter
Prefixes and Modifications
Team invented four prefixes allowed for block names:
 b- common blocks
 h- holsters, used for gluing several elements together
 l- layout grids
 g- global styles
Modification can be defined as a specific state of a block, or as a
flag that holds some specific property.
Going open source
In 2010, team had published some code on
GitHub account to continue growing as an
open source project.
BEM: HOW IT WORKS?
BEM: HOW IT WORKS?
Mark out “blocks”
Definitions
Blocks
A block is an independent entity, a "building block" of an application.
A block can be either simple or compound (containing other blocks).
E.g. Search form block
Elements
An element is a part of a block that performs a certain function.
Elements are context-dependent: they only make sense in the
context of the block they belong to.
E.g. An input field and a button are elements of the Search Block
BEM: HOW IT WORKS?
Describe page layout in plain text
BEM: HOW IT WORKS?
Block independence
From the CSS point of view
 A block (or an element) must have a unique "name" (a CSS
class) that could be used in a CSS rule.
 HTML elements must not be used in CSS selectors (.menu td) as
such selectors are inherently not context-free.
 Cascading selectors should be avoided.
From the template engine perspective
 Blocks and elements must be described in the input data Blocks
(or elements) must have unique "names" to make things like
"Menu should be placed here" expressible in our templates.
 Blocks may appear anywhere in a BEM tree.
BEM: HOW IT WORKS?
Modifiers for blocks
BEM: HOW IT WORKS?
Subject-matter abstraction
BEM: HOW IT WORKS?
Blocks consistency
Blocks consistency
To have a block present on a page as a UI element it should be
implemented it in the following techs:
 Templates (XSL, TT2, JavaScript, etc), which turn block
declarations into HTML code
 CSS that describes appearance of the block
 A JavaScript implementation for the block, if a block has dynamic
behavior
 Images
 Documentation
Everything that constitutes a block is a block technology.
BEM: HOW IT WORKS?
Real examples
Real examples
All the services of Yandex have BEM in their CSS and JavaScript
code and XSL templates of the pages. E.g.
 Yandex.Maps
 Yandex.Images
 Yandex.Video
 Yandex.Auto
 Turkish Yandex
More examples:
 Rambler.News
 HeadHunter
 TNK Racing Team
LIBRARIES
BEM libraries
 bem-core is a core library required for starting your own BEM-
powered project. It provides sufficient number of blocks
necessary for client-side JavaScript coding and templating.
 bem-bl is an extended library that consists not only of basic
blocks but also of a number of generic solutions for displaying a
menu, text, logo, search tab, table and so on.
 bem-components is a library of web-forms management blocks.
It contains basic implementation techniques independent from
design and allows to apply optional themes such as new
Yandex.Islands design.
 More libraries
TOOLS
TOOLS
bem-tools
bem-tools
A toolkit for working with files based on BEM methodology.
It allows to:
 create entities
 build final runtime
 work with build declarations: merge, subtract and intersect them
 build the whole project using bem make command
 launch development server on the project source tree using bem
server command.
 Documentation: https://en.bem.info/tools/bem/bem-tools/
TOOLS
Testing
Testing
Gemini is the utility for regression testing of web pages appearance.
Its key features are:
 Compatibility with different browsers (see notes about IE);
 Ability to test separate sections of a web page;
 Position and size of an element are calculated including its box-shadow and
outline properties;
 Some special case differences between images (rendering artifacts, text
caret, etc.) are ignored;
 CSS test coverage statistics.
Documentation: https://en.bem.info/tools/testing/gemini/
html-differ
Documentation: https://en.bem.info/tools/testing/html-differ/
TOOLS
Optimizers
Optimizers
borschik is an extendable builder for text-based file formats. Its main
purpose is assembly of static files for web projects (CSS, JS, etc.).
Documentation: https://en.bem.info/tools/optimizers/borschik/
CSSO (CSS Optimizer) is a CSS minimizer unlike others. In
addition to usual minification techniques it can perform structural
optimization of CSS files, resulting in smaller file size compared to
other minifiers.
Documentation: https://en.bem.info/tools/optimizers/csso/
SVG Optimizer is a Nodejs-based tool for optimizing SVG vector
graphics files.
Documentation: https://en.bem.info/tools/optimizers/svgo/svgo/
TOOLS
Languages / Parsers
Languages / Parsers
OMetaJS is a JavaScript implementation of OMeta, an object-
oriented language for pattern matching.
Documentation: https://github.com/veged/ometa-js#ometajs
XJST is a DSL for universal data transformations with compiler
written on top of the node.js and ometajs and output code working
in any browser or on server-side.
Documentation: http://en.bem.info/tools/templating-engines/xjst/
Shmakowiki is yet another wiki dialect, inspired by WackoWiki and
WikiCreole.
Documentation: https://github.com/veged/shmakowiki
REFERENCES
References
 https://en.bem.info/
 http://getbem.com/
 https://github.com/bem
 https://css-tricks.com/bem-101/
 https://tech.yandex.ru/bem/
Oleksii Prohonnyi
facebook.com/oprohonnyi
linkedin.com/in/oprohonnyi

More Related Content

What's hot

Web Development - HTML, CSS, JavaScript
Web Development - HTML, CSS, JavaScriptWeb Development - HTML, CSS, JavaScript
Web Development - HTML, CSS, JavaScript
Mark John Lado, MIT
 
Rendering engine
Rendering engineRendering engine
Rendering engine
Dharita Chokshi
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
Sohaib Chaudhery
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
Reem Alattas
 
Html book2
Html book2Html book2
Html book2
Diksha Garg
 
Html viva questions
Html viva questionsHtml viva questions
Html viva questions
Vipul Naik
 
Dhtml
DhtmlDhtml
Web Design & Development Courses in Pune | 3DOT Technologies
Web Design & Development Courses  in Pune | 3DOT TechnologiesWeb Design & Development Courses  in Pune | 3DOT Technologies
Web Design & Development Courses in Pune | 3DOT Technologies
abeda786
 
C language
C languageC language
C language
omprakash810
 
C language
C languageC language
C language
omprakash810
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
yht4ever
 
DHTML
DHTMLDHTML
Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
Randy Connolly
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
Vskills
 

What's hot (18)

Web Development - HTML, CSS, JavaScript
Web Development - HTML, CSS, JavaScriptWeb Development - HTML, CSS, JavaScript
Web Development - HTML, CSS, JavaScript
 
Rendering engine
Rendering engineRendering engine
Rendering engine
 
Extjs
ExtjsExtjs
Extjs
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
 
Dhtml chapter2
Dhtml chapter2Dhtml chapter2
Dhtml chapter2
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
Html book2
Html book2Html book2
Html book2
 
Html viva questions
Html viva questionsHtml viva questions
Html viva questions
 
Dhtml
DhtmlDhtml
Dhtml
 
Web Design & Development Courses in Pune | 3DOT Technologies
Web Design & Development Courses  in Pune | 3DOT TechnologiesWeb Design & Development Courses  in Pune | 3DOT Technologies
Web Design & Development Courses in Pune | 3DOT Technologies
 
Dom structure
Dom structureDom structure
Dom structure
 
Xhtml
XhtmlXhtml
Xhtml
 
C language
C languageC language
C language
 
C language
C languageC language
C language
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
DHTML
DHTMLDHTML
DHTML
 
Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 

Viewers also liked

10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
10 Commandments for efficient CSS architecture [CSSConf.Asia '14]10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
kushagra Gour
 
Odnaleźć się w nanokosmosie
Odnaleźć się w nanokosmosieOdnaleźć się w nanokosmosie
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101
Eric Sembrat
 
BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)
Jyaasa Technologies
 
BEM : Block Element Modifier
BEM : Block Element ModifierBEM : Block Element Modifier
BEM : Block Element Modifier
Sooyoos
 
The benefits of BEM CSS
The benefits of BEM CSSThe benefits of BEM CSS
The benefits of BEM CSS
Bob Donderwinkel
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and Selenium
Nikolay Vasilev
 
Bem i SCSS na przykladzie inuit.css
Bem i SCSS na przykladzie inuit.cssBem i SCSS na przykladzie inuit.css
Bem i SCSS na przykladzie inuit.css
Michał Załęcki
 
BEM. What you can borrow from Yandex frontend dev
BEM. What you can borrow from Yandex frontend devBEM. What you can borrow from Yandex frontend dev
BEM. What you can borrow from Yandex frontend dev
Varya Stepanova
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
Enduring CSS
Enduring CSSEnduring CSS
Enduring CSS
Takazudo
 

Viewers also liked (11)

10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
10 Commandments for efficient CSS architecture [CSSConf.Asia '14]10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
10 Commandments for efficient CSS architecture [CSSConf.Asia '14]
 
Odnaleźć się w nanokosmosie
Odnaleźć się w nanokosmosieOdnaleźć się w nanokosmosie
Odnaleźć się w nanokosmosie
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101
 
BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)
 
BEM : Block Element Modifier
BEM : Block Element ModifierBEM : Block Element Modifier
BEM : Block Element Modifier
 
The benefits of BEM CSS
The benefits of BEM CSSThe benefits of BEM CSS
The benefits of BEM CSS
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and Selenium
 
Bem i SCSS na przykladzie inuit.css
Bem i SCSS na przykladzie inuit.cssBem i SCSS na przykladzie inuit.css
Bem i SCSS na przykladzie inuit.css
 
BEM. What you can borrow from Yandex frontend dev
BEM. What you can borrow from Yandex frontend devBEM. What you can borrow from Yandex frontend dev
BEM. What you can borrow from Yandex frontend dev
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
Enduring CSS
Enduring CSSEnduring CSS
Enduring CSS
 

Similar to BEM methodology overview

BEM it!
BEM it!BEM it!
BEM it!
Max Shirshin
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
Max Shirshin
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM
Varya Stepanova
 
web development presentation computer science
web development presentation computer scienceweb development presentation computer science
web development presentation computer science
girijasharma7777
 
Introduction to whats new in css3
Introduction to whats new in css3Introduction to whats new in css3
Introduction to whats new in css3
Usman Mehmood
 
HTML and CSS Coding Standards
HTML and CSS Coding StandardsHTML and CSS Coding Standards
HTML and CSS Coding Standards
Saajan Maharjan
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
Randy Connolly
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan Rosu
Razvan Rosu
 
Magento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft ChinaMagento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft China
Bysoft Technologies
 
Rock Solid CSS Architecture
Rock Solid CSS ArchitectureRock Solid CSS Architecture
Rock Solid CSS Architecture
John Need
 
Getting Started with Gutenberg Development
Getting Started with Gutenberg DevelopmentGetting Started with Gutenberg Development
Getting Started with Gutenberg Development
Jason Yingling
 
The Cascade is Dead
The Cascade is DeadThe Cascade is Dead
The Cascade is Dead
chriseppstein
 
.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12
aminmesbahi
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolAdriaan Venter
 
Pem Overview20090130
Pem Overview20090130Pem Overview20090130
Pem Overview20090130
brianlbrinker
 
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPFeature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPAyman El-Hattab
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Sean Burgess
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JS
Richard Homa
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13Shahzad S
 

Similar to BEM methodology overview (20)

BEM it!
BEM it!BEM it!
BEM it!
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM
 
web development presentation computer science
web development presentation computer scienceweb development presentation computer science
web development presentation computer science
 
BEM
BEMBEM
BEM
 
Introduction to whats new in css3
Introduction to whats new in css3Introduction to whats new in css3
Introduction to whats new in css3
 
HTML and CSS Coding Standards
HTML and CSS Coding StandardsHTML and CSS Coding Standards
HTML and CSS Coding Standards
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan Rosu
 
Magento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft ChinaMagento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft China
 
Rock Solid CSS Architecture
Rock Solid CSS ArchitectureRock Solid CSS Architecture
Rock Solid CSS Architecture
 
Getting Started with Gutenberg Development
Getting Started with Gutenberg DevelopmentGetting Started with Gutenberg Development
Getting Started with Gutenberg Development
 
The Cascade is Dead
The Cascade is DeadThe Cascade is Dead
The Cascade is Dead
 
.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling Tool
 
Pem Overview20090130
Pem Overview20090130Pem Overview20090130
Pem Overview20090130
 
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPFeature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JS
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13
 

More from Oleksii Prohonnyi

Utility libraries to make your life easier
Utility libraries to make your life easierUtility libraries to make your life easier
Utility libraries to make your life easier
Oleksii Prohonnyi
 
Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0
Oleksii Prohonnyi
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
Oleksii Prohonnyi
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: Performance
Oleksii Prohonnyi
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: Architecture
Oleksii Prohonnyi
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
Oleksii Prohonnyi
 
Cycle.js overview
Cycle.js overviewCycle.js overview
Cycle.js overview
Oleksii Prohonnyi
 
Moment.js overview
Moment.js overviewMoment.js overview
Moment.js overview
Oleksii Prohonnyi
 
Bower introduction
Bower introductionBower introduction
Bower introduction
Oleksii Prohonnyi
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
Oleksii Prohonnyi
 
Conference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewConference DotJS 2015 Paris review
Conference DotJS 2015 Paris review
Oleksii Prohonnyi
 
Asm.js introduction
Asm.js introductionAsm.js introduction
Asm.js introduction
Oleksii Prohonnyi
 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSource
Oleksii Prohonnyi
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
Oleksii Prohonnyi
 
OpenLayer's basics
OpenLayer's basicsOpenLayer's basics
OpenLayer's basics
Oleksii Prohonnyi
 
Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)
Oleksii Prohonnyi
 
Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)
Oleksii Prohonnyi
 
Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?
Oleksii Prohonnyi
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
Oleksii Prohonnyi
 

More from Oleksii Prohonnyi (20)

Utility libraries to make your life easier
Utility libraries to make your life easierUtility libraries to make your life easier
Utility libraries to make your life easier
 
Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: Performance
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: Architecture
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
 
Cycle.js overview
Cycle.js overviewCycle.js overview
Cycle.js overview
 
Moment.js overview
Moment.js overviewMoment.js overview
Moment.js overview
 
Bower introduction
Bower introductionBower introduction
Bower introduction
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
 
Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
 
Conference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewConference DotJS 2015 Paris review
Conference DotJS 2015 Paris review
 
Asm.js introduction
Asm.js introductionAsm.js introduction
Asm.js introduction
 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSource
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
 
OpenLayer's basics
OpenLayer's basicsOpenLayer's basics
OpenLayer's basics
 
Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)Front-end rich JavaScript application creation (Backbone.js)
Front-end rich JavaScript application creation (Backbone.js)
 
Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)Как создать сайт за 2 часа? (Wordpress)
Как создать сайт за 2 часа? (Wordpress)
 
Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?Разработка веб-сайта. Сайт. Зачем он?
Разработка веб-сайта. Сайт. Зачем он?
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
 

Recently uploaded

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 

Recently uploaded (20)

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 

BEM methodology overview

  • 1. BEM methodology overview _by Oleksii Prohonnyi
  • 3.
  • 4. BEM (stands for Block, Element, Modifier) It's a way of describing reality in code, a range of patterns, and a way of thinking about program entities regardless of programming languages being used. <bem.info>
  • 6. From 2005 CSS classes for blocks got prefixes (b-, c-, g-) to provide sort of a namespace emulation in CSS.
  • 7.
  • 8.
  • 9. Independent Block concept was the basis of Yandex HTML layouts, was featured at the ClientSide'2007 conference in Moscow, Russia.
  • 10. Absolutely Independept Block (AIB)  Only classnames (not IDs) should be used to describe styles.  Each block classname has a prefix.  Any CSS rules except ones prefixed with g- must belong to a block.  Compound blocks were allowed (or sometimes, required) to have nested blocks embedded.  never match CSS to tagnames, use classnames for everything: .b-user b -> .b-user .first-letter  classnames for block elements must be prefixed with the parent block name: .b-user .first-letter -> .b-user-first_letter
  • 11. Prefixes and Modifications Team invented four prefixes allowed for block names:  b- common blocks  h- holsters, used for gluing several elements together  l- layout grids  g- global styles Modification can be defined as a specific state of a block, or as a flag that holds some specific property.
  • 12. Going open source In 2010, team had published some code on GitHub account to continue growing as an open source project.
  • 13. BEM: HOW IT WORKS?
  • 14.
  • 15. BEM: HOW IT WORKS? Mark out “blocks”
  • 16.
  • 17. Definitions Blocks A block is an independent entity, a "building block" of an application. A block can be either simple or compound (containing other blocks). E.g. Search form block Elements An element is a part of a block that performs a certain function. Elements are context-dependent: they only make sense in the context of the block they belong to. E.g. An input field and a button are elements of the Search Block
  • 18.
  • 19. BEM: HOW IT WORKS? Describe page layout in plain text
  • 20.
  • 21.
  • 22. BEM: HOW IT WORKS? Block independence
  • 23.
  • 24. From the CSS point of view  A block (or an element) must have a unique "name" (a CSS class) that could be used in a CSS rule.  HTML elements must not be used in CSS selectors (.menu td) as such selectors are inherently not context-free.  Cascading selectors should be avoided.
  • 25. From the template engine perspective  Blocks and elements must be described in the input data Blocks (or elements) must have unique "names" to make things like "Menu should be placed here" expressible in our templates.  Blocks may appear anywhere in a BEM tree.
  • 26. BEM: HOW IT WORKS? Modifiers for blocks
  • 27.
  • 28.
  • 29.
  • 30. BEM: HOW IT WORKS? Subject-matter abstraction
  • 31.
  • 32. BEM: HOW IT WORKS? Blocks consistency
  • 33. Blocks consistency To have a block present on a page as a UI element it should be implemented it in the following techs:  Templates (XSL, TT2, JavaScript, etc), which turn block declarations into HTML code  CSS that describes appearance of the block  A JavaScript implementation for the block, if a block has dynamic behavior  Images  Documentation Everything that constitutes a block is a block technology.
  • 34. BEM: HOW IT WORKS? Real examples
  • 35. Real examples All the services of Yandex have BEM in their CSS and JavaScript code and XSL templates of the pages. E.g.  Yandex.Maps  Yandex.Images  Yandex.Video  Yandex.Auto  Turkish Yandex More examples:  Rambler.News  HeadHunter  TNK Racing Team
  • 37. BEM libraries  bem-core is a core library required for starting your own BEM- powered project. It provides sufficient number of blocks necessary for client-side JavaScript coding and templating.  bem-bl is an extended library that consists not only of basic blocks but also of a number of generic solutions for displaying a menu, text, logo, search tab, table and so on.  bem-components is a library of web-forms management blocks. It contains basic implementation techniques independent from design and allows to apply optional themes such as new Yandex.Islands design.  More libraries
  • 38. TOOLS
  • 40. bem-tools A toolkit for working with files based on BEM methodology. It allows to:  create entities  build final runtime  work with build declarations: merge, subtract and intersect them  build the whole project using bem make command  launch development server on the project source tree using bem server command.  Documentation: https://en.bem.info/tools/bem/bem-tools/
  • 42. Testing Gemini is the utility for regression testing of web pages appearance. Its key features are:  Compatibility with different browsers (see notes about IE);  Ability to test separate sections of a web page;  Position and size of an element are calculated including its box-shadow and outline properties;  Some special case differences between images (rendering artifacts, text caret, etc.) are ignored;  CSS test coverage statistics. Documentation: https://en.bem.info/tools/testing/gemini/ html-differ Documentation: https://en.bem.info/tools/testing/html-differ/
  • 44. Optimizers borschik is an extendable builder for text-based file formats. Its main purpose is assembly of static files for web projects (CSS, JS, etc.). Documentation: https://en.bem.info/tools/optimizers/borschik/ CSSO (CSS Optimizer) is a CSS minimizer unlike others. In addition to usual minification techniques it can perform structural optimization of CSS files, resulting in smaller file size compared to other minifiers. Documentation: https://en.bem.info/tools/optimizers/csso/ SVG Optimizer is a Nodejs-based tool for optimizing SVG vector graphics files. Documentation: https://en.bem.info/tools/optimizers/svgo/svgo/
  • 46. Languages / Parsers OMetaJS is a JavaScript implementation of OMeta, an object- oriented language for pattern matching. Documentation: https://github.com/veged/ometa-js#ometajs XJST is a DSL for universal data transformations with compiler written on top of the node.js and ometajs and output code working in any browser or on server-side. Documentation: http://en.bem.info/tools/templating-engines/xjst/ Shmakowiki is yet another wiki dialect, inspired by WackoWiki and WikiCreole. Documentation: https://github.com/veged/shmakowiki
  • 48. References  https://en.bem.info/  http://getbem.com/  https://github.com/bem  https://css-tricks.com/bem-101/  https://tech.yandex.ru/bem/
  • 49.