SlideShare uma empresa Scribd logo
1 de 50
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

Mais conteúdo relacionado

Mais procurados (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
 

Destaque

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
 
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 101Eric 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 ModifierSooyoos
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and SeleniumNikolay 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.cssMichał 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 devVarya Stepanova
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
Enduring CSS
Enduring CSSEnduring CSS
Enduring CSSTakazudo
 

Destaque (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
 

Semelhante a BEM methodology overview

BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for BrandwatchMax Shirshin
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEMVarya Stepanova
 
Introduction to whats new in css3
Introduction to whats new in css3Introduction to whats new in css3
Introduction to whats new in css3Usman Mehmood
 
HTML and CSS Coding Standards
HTML and CSS Coding StandardsHTML and CSS Coding Standards
HTML and CSS Coding StandardsSaajan 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 AppearanceRandy Connolly
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan RosuRazvan Rosu
 
Magento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft ChinaMagento - Design Integration Guideline - Bysoft China
Magento - Design Integration Guideline - Bysoft ChinaBysoft Technologies
 
Rock Solid CSS Architecture
Rock Solid CSS ArchitectureRock Solid CSS Architecture
Rock Solid CSS ArchitectureJohn Need
 
Getting Started with Gutenberg Development
Getting Started with Gutenberg DevelopmentGetting Started with Gutenberg Development
Getting Started with Gutenberg DevelopmentJason Yingling
 
.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 12aminmesbahi
 
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 Overview20090130brianlbrinker
 
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 TemplateSean Burgess
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSRichard Homa
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13Shahzad S
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency worldChris Lowe
 

Semelhante a 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
 
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
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency world
 

Mais de 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 easierOleksii 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.0Oleksii Prohonnyi
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceOleksii Prohonnyi
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceOleksii Prohonnyi
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureOleksii Prohonnyi
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionOleksii Prohonnyi
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesOleksii Prohonnyi
 
Conference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewConference DotJS 2015 Paris review
Conference DotJS 2015 Paris reviewOleksii Prohonnyi
 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSourceOleksii 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
 
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 overviewOleksii Prohonnyi
 

Mais de 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
 

Último

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 

Último (20)

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 

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.