BEM (Block, Element, Modifier) is a methodology for structuring CSS and HTML code. It aims to avoid name collisions, keep specificity low, and make code more maintainable. Key principles include:
1. Using a naming convention of block-name__element-name--modifier to identify components, their parts, and variants.
2. Organizing CSS and HTML files by component in a flat directory structure to locate code easily.
3. Avoiding global selectors and name prefixes to prevent unintended side effects.
4. Keeping selectors shallow and specificity low to allow flexible overriding without !important declarations.
With the advent of CSS-in-JS, the cascade is less and less relevant to developers, but there's a lot that stylesheets have to offer. In this presentation, Chris Eppstein discusses the new Stylesheet framework and optimizer that LinkedIn is building.
Contribución en la IV Jornada de Buenas Prácticas en la docencia universitaria con apoyo de TIC organizada por la Cátedra Banco Santander de la Universidad de Zaragoza y realizada el 10 de septiembre de 2013 en el Edificio Paraninfo.
Autores de la contribución:
Jesús Sergio Artal Sevil, Julio Caraballo Jiménez y Ricardo Bandrés Lasheras del Departamento de Ingeniería Eléctrica de la Universidad de Zaragoza.
Entrepreneur Community Profile Jaringan Rumah UsahaDIJIMEDIA
Jaringan Rumah Usaha (JRU) is entrepreneurship community from Semarang, Central Java Province, Indonesia. JRU focusing on people development on mentality, their competencies are in creative industry and also engaging urban society.
Mau Tahu tentang Sentuhan Spiritual Quantum Spiritual Qalbu? apa manfaat Sentuhan Spiritual Quantum Spiritual Qalbu dalam kehidupan sehari-hari. simak di slide berikut ini.
Pastikan Ikuti Training Quantum Spiritual Qalbu ini dan simak info selengkapnya di www.quantumhati.com
Prezentacja Michała Brzezicki z 9 spotkania Data Science Warsaw przedstawiająca w jaki sposób pobierane i analizowane są dane w SentiOne. Opowiada o problemach związanych z crawlowaniem ponad pół miliona domen oraz dlaczego Hadoop i ElasticSearch jest fajny i na ilu dyskietkach mieści się 5,7 miliarda przeanalizowanych wypowiedzi.
An in depth introduction to the BEM methodology and how to use it in the wild. The slides cover the key concepts of Block-Element-Modifier as well as their usage in HTML and CSS. Furthermore the presentation covers on how BEM can solve well-known CSS challenges.
With the advent of CSS-in-JS, the cascade is less and less relevant to developers, but there's a lot that stylesheets have to offer. In this presentation, Chris Eppstein discusses the new Stylesheet framework and optimizer that LinkedIn is building.
Contribución en la IV Jornada de Buenas Prácticas en la docencia universitaria con apoyo de TIC organizada por la Cátedra Banco Santander de la Universidad de Zaragoza y realizada el 10 de septiembre de 2013 en el Edificio Paraninfo.
Autores de la contribución:
Jesús Sergio Artal Sevil, Julio Caraballo Jiménez y Ricardo Bandrés Lasheras del Departamento de Ingeniería Eléctrica de la Universidad de Zaragoza.
Entrepreneur Community Profile Jaringan Rumah UsahaDIJIMEDIA
Jaringan Rumah Usaha (JRU) is entrepreneurship community from Semarang, Central Java Province, Indonesia. JRU focusing on people development on mentality, their competencies are in creative industry and also engaging urban society.
Mau Tahu tentang Sentuhan Spiritual Quantum Spiritual Qalbu? apa manfaat Sentuhan Spiritual Quantum Spiritual Qalbu dalam kehidupan sehari-hari. simak di slide berikut ini.
Pastikan Ikuti Training Quantum Spiritual Qalbu ini dan simak info selengkapnya di www.quantumhati.com
Prezentacja Michała Brzezicki z 9 spotkania Data Science Warsaw przedstawiająca w jaki sposób pobierane i analizowane są dane w SentiOne. Opowiada o problemach związanych z crawlowaniem ponad pół miliona domen oraz dlaczego Hadoop i ElasticSearch jest fajny i na ilu dyskietkach mieści się 5,7 miliarda przeanalizowanych wypowiedzi.
An in depth introduction to the BEM methodology and how to use it in the wild. The slides cover the key concepts of Block-Element-Modifier as well as their usage in HTML and CSS. Furthermore the presentation covers on how BEM can solve well-known CSS challenges.
Presentation to the Triangle Drupal Users Group (TriDUG) July meeting. This is a brief overview of what CSS selectors are and how they can be used to target CSS at specific parts of Drupal pages.
Note: This was done using the Fusion Starter theme in Drupal 7 but is applicable to D6 and other "major" themes.
Sorry, the slide animations did not come thru... but only the before and after slide really got effected.
This presentation uncover what is CSS architecture and why it is important to have one. Most of the modern CSS architectures based on principles/rules outlined in this presentation.
Front end workflow Presentation at Coffee@DBG by Praveen VijayanDeepu S Nath
The primary objective of this presentation is to get an idea about end-to-end front-end workflow and useful tools. We will discuss hot tools like Yeoman, Grunt and Bower. But the session is not limited to these tools - we will touch each phase of front-end development like boiler-plating, preprocessors, performance, documentation, code quality, reporting and architecture etc.
Ever tried to maintain a design system across a large site? Collaborated with a front-end designer or front-end developer who wants to design/code in the style guide, but can’t see what impacts that will have on the actual site? Do you use and maintain a single design or brand across multiple sites? Are you building on design frameworks like Bootstrap or Foundation but not sure if you’re “doing it right”?
At the conclusion of this Meetup you will have a better understanding of what it takes to design, build and support more scalable, systemized designs.
In this two part presentation, we’ll first present an overview of pattern libraries, atomic design, and design systems. You’ll understand these important concepts and be prepared to start thinking about how to use them in your work.
We’ll then show you how Exygy uses pattern libraries in a way that empowers our designers and engineers to collaborate effectively and efficiently as a team. We’ll touch on leveraging pattern library specific tools like Fabricator (using Node.js and Handlebars templates), and finish with a solution for creating and maintaining a pattern library within WordPress and integrating it into the templates for your custom WordPress theme.
about this presentation:
1) this presentation was a quickie for non-tech employees, who wanted a basic understanding of html/css, as it related to a white-label SAAS product;
2) the back-end/front-end definitions relate to the specific application (it's inaccurate if node.js is in the picture)
Tired of eating CSS soup day after day? No longer want to play stylesheet Jenga whenever you try to edit main.css? You just may need a CSS architecture. This talk will review the major CSS architectures like BEM (Block Element Modifier) and SMACSS (Scalable and Modular Architecture for CSS) while discussing the pros and cons of each.
5. In other words
1
2
3
4
1,0,0,0 — If the element has inline styling, that automatically wins
0,1,0,0 — For each ID value
0,0,1,0 — For each class, pseudo-class, attribute selector
0,0,0,1 — For each element reference
8. Important Notes
1
2
3
The universal selector (*) has no specificity value (0,0,0,0)
Pseudo-elements (e.g. :first-line) get 0,0,0,1 unlike their
psuedo-class brethren which get 0,0,1,0
The pseudo-class :not() adds no specificity by itself, only
what's inside it's parentheses.
14. !important
Consequences
1
2
3
one more level of complexity
specificity grows even faster
finding out what a rule will be applied still is not easy
4 eventually, working with such code comes to nearly impossible
15. !important
Specificity can, among other things:
1
2
3
limit your ability to extend and manipulate a codebase
interrupt and undo CSS cascading, inheriting nature
cause avoidable verbosity in your project
4
prevent things from working as expected when moved into
different environments
5 lead to serious developer frustration
29. BEM naming conventions
1
2
3
Names of BEM entities are written using numbers
and lowercase Latin characters
Individual words within names are separated by a hyphen (-)
Information about the names of blocks, elements,
and modifiers is stored using CSS classes
31. BEM element name
HTML
CSS
EXAMPLE menu__item, lang-switcher__lang-icon
<div class=“menu">
<span class=“menu__item"></span>
</div>
SCHEME block-name__elem-name
.menu__item { color: red; }
36. File system organization
1
2
3
A block implementation is divided into separate parts
Optional elements and modifiers are stored in separate files
Files are grouped by meaning and not by type
4 A project is divided into redefinition levels
37. Block on the filesystem
blocks/
input/ # input block directory
button/ # button block directory
40. How BEM helps
The naming convention helps to:
1
2
3
avoid name conflicts
avoid the cascade and keep the specificity for all declarations
on the same low level
write self-documenting code
41. Enter header
BEM file organization has its benefits:
1
2
3
One block - one folder. Easy to combine in the production
build only those blocks which are really used on the page.
All-in-one. Easy to remove blocks or move themto another project.
Plain folders list helps to avoid naming conflicts. You just
cannot add a new folder if name is already taken.
42. A block or an element: when should I use which?
52. When I can use a few selectors in one declaration?
.theme-dark-sky .button { … }
53. Bottom line
1
2
3
Keep specificity low at all times
Do not mix a few BEM entities on one node
Do not use global classes and prefixes
4 Keep files related to the same block in the same folder