2. ME
Enthusiast about Javascript, CSS and Web
technologies
Looking forward to invest into promising
swiss startups
www.vittoriozaccaria.net
vittorio.zaccaria@gmail.com
23. it’s a set of formalized guidelines developed by
Yandex, RU in the past few years
it is mainly a naming and structuring
methodology for CSS/HTML
24. How to define and
structure modules for
CSS, enabling separation
How to of concerns and reuse
organize files
Tools for manipulating
BEM compliant specs
although it has more…
25. BEM defines the concept of “block” for CSS
we will call it also “component” or “module”
26. block
• html + style rules
• independent w.r.t. other blocks
• can be used in different parts/projects
27.
28.
29.
30. how BEM would define this block
1. use only one class - they flatten specificity
2. no positioning information in it
3. dont introduce relative adjustment
31. .art-preview {
width: 30%;
...
}
.art-preview
CSS
no parent blocks here, or
we’d compromise reuse and mobility
32. modifier
changes a small amount of properties of a block
it is another class to be added to the block itself
62. MVCSS BEM SMACSS
block
element
modifier
Scalable and modular CSS
https://smacss.com/
base
applies to tags and ids
layout Nesting similar to
grids and stuff
modules
subclassing
states
Modular View CSS
http://mvcss.github.io/
foundation reset
structures
not reusable patterns
components reusable patterns
65. create your own tags!
HTML
<!-- Polyfill Web Components support for older browsers -->
<script src="components/platform/platform.js"></script>
!
<!-- Import element -->
<link rel="import" href="counter.html">
!
<!-- Use element -->
<my-counter counter="10">Points</my-counter>