SlideShare ist ein Scribd-Unternehmen logo
1 von 133
Downloaden Sie, um offline zu lesen
BEM
What you can borrow from
Yandex frontend dev


Frontend developer
Varvara Stepanova
Over 80 services


    • search
      – web pages
      – images, video
      – goods, news, blog posts, people
    • web mail
    • web maps
      – traffic jams, wiki maps, taxi
    • hosting and sharing
      – files, photos, video

5
Inside Yandex




    • 2500 developers
    • 150+ frontend developers




6
Dark side of the Force
Programming is a team work
Developers community
We do enjoy sharing
Web Interface
Behind the page
                                         HTML
     <!DOCTYPE html>
     <html>
       <head>...</head>
       <body>
         ...
       </body>

                                          CSS
     body {
        font: 0.8em Arial, sans-serif;
        margin: 0;
        color: black;
     }
     .sidebar ul li {

13
Block
Menu block



                                                  HTML
     <ul class="menu">
       <li><a href="/new">New titiles</a></li>
       <li><a href="/soon">Coming soon</a></li>
       <li><a href="/best">Bestsellers</a></li>
       ...

                                                   CSS
     .menu {
       list-style: none;


20
Search block



                                                           HTML
     <div class="search">
       <input type="text" name="search" value="..."/>
       <input type="button" name="sbmt" value="Search"/>
     </div>


                                                            CSS
     .search {
       padding: 2em 0;


20
21
Tabbed pane block
                                                        HTML
                     <div class="tabbed-pane">
                       <ul>
                         <li>Bestsellers</li><li>...</li>
                       </ul>
                       <div>
                         The Casual Vacancy, J.K. Rowling
                       </div>
                     </div>


                                                            CSS
                     .tabbed-pane {
                       margin: 0.5em;
                       ...
                     }

22
INDEPENDENT
The page of blocks
                                        index.html
      <!DOCTYPE html>
      <html>
       <head>..</head>
       <body>

       <div class="head">
        <div class="logo">...</div>
        <ul class="menu">...</ul>
        <div class="search">...</div>
       </div>

       <div class="layout">...</div>

       <div class="foot">...</div>

       </body>
      </html>

24
Repeating
Menu block




                      HTML                       HTML
     <ul id="menu">          <ul class="menu">
       ...                     ...



                       CSS                        CSS
     #menu {                 .menu {
      ...                      ...



27
Block is independent, if




     • a block has its "name"
       – no "id" but "classname" selectors
     • avoids cascade
     • no "tag" selectors


28
Movement within a Page
Block is independent, if




     • a block has its "name"
       – no "id" but "classname" selectors
     • avoid cascade
     • no "tag" selectors


31
almost NO CASCADE
     when using Cascading Style Sheets




32
Moving within a Site
Pages are sets of blocks
           index page   search page   contacts page




40
CSS for different pages

                common.css                index.css
                                           style.css            contacts.css
     body { ... }            body { { }
                             .advert... ... }          body .phone {
                             .head { .. }                ...
     .head { ... }           .head ul li { ...
                             .layout .books} {         }
                             a:link, ... { ... }
                               ...
     .head ul li {           .advert { ... }
                             }                         .phone a {
       ...                   .layout .books { ... }      ...
     }                       body .phone { ... }       }
                             .phone a { ... }
     a:link, ... {           #map { ... }              #map {
     }                                                 }




41
Pages are sets of blocks
           index page   search page   contacts page




44
CSS for every block




      blocks/
        header.css
        menu.css
        button.css
        tabbed-pane.css
        logo.css
        footer.css




45
CSS for a page
                                             index.css
      @import url(blocks/header.css);
      @import url(blocks/menu.css);
      @import url(blocks/tabbed-pane.css);
      @import url(blocks/text.css);
      @import url(blocks/logo.css);
      @import url(blocks/footer.css);
      ...




46
Project file system

      blocks/              pages/

        advert.css          index.html
        books-list.css      index.css
        head.css
        foot.css            contacts.html
        logo.css            contacts.css
        menu.css
        search.css          book.html
        tabbed-pane.css     book.css


47
WE NEED TO GO




   DEEPER
Inside a Block
Menu block




                                                  HTML
     <ul class="menu">
       <li><a href="/new">New titles</a></li>
       <li><a href="/soon">Coming soon</a></li>
       <li><a href="/best">Bestsellers</a></li>
       ...
     </ul>




50
Menu block




                                blocks/menu.css
     .menu li
     {
       list-style: none;
       display: inline-block;
       padding: 0 0.5em;
     }




51
Menu and Dropdown blocks




                  blocks/menu.css                          pages/index.html
      .menu li                      <li>
      {                                <a href="#">Bestsellers</a>
        list-style: none;              <div class="dropdown">
        display: inline-block;
        padding: 0 0.5em;                <ul>
      }                                    <li>Item One</li>
                                           <li>Item Two</li>
                                           <li>The best item</li>
                                           <li>Item Three</li>

52
Block is independent, if




     • a block has its "name"
       – no "id" but "classname" selectors
     • avoid cascade
     • no "tag" selectors


53
The style system matches rules by starting with the key
     selector, then moving to the left (looking for any ancestors
     in the rule’s selector).
      David Hyatt, MDN




                         mzl.la/UuwZql


54
.menu li {




55
.menu li {




56
Menu block




57
Element
Elements




59
Search block




60
Tabbed-pane block




61
Menu




                                                                  page.html
     <ul class="menu">
       <li class="menu__item"><a href="/">Index</a></li>
       <li class="menu__item"><a href="/new">New</a></li>
       <li class="menu__item"><a href="/offer">Special offer</a></li>
       <li class="menu__item"><a href="/shipping">Shipping</a></li>
     </ul>




62
Menu




                    blocks/menu.css
     .menu li                         .tabbed-pane__tab
     {
       list-style: none;
       display: inline-block;         .block-element
       padding: 0 0.5em;              .block--element
     }                                .block___element




63
Optional elements




64
Files for elements


      blocks/

        search.css                menu.css
        search__checkbox.css      menu__item.css
        search__autocomlete.css

        tabbed-pane.css           book.css
        tabbed-pane__tab.css      book__title.css
        tabbed-pane__pane.css     book__image.css


65
Modifier
Similar but different




67
Modifier
                                                    HTML

      <div class="tabbed-pane tabbed-pane_theme_blue">
        <ul>
          <li class="tabbed-pane__tab">Tab 1</li>
          <li class="tabbed-pane__tab">Tab 2</li>
        </ul>
        <div class="tabbed-pane__pane">
          ...
        </div>
      </div>



68
Modifier
                                                   HTML

      <div class="tabbed-pane
                  tabbed-pane_theme_blue
                  tabbed-pane_direction_bottom">
        ...
      </div>

      <input class="button
                    button_theme_black
                    button_size_l" ... />



69
block-name_mod-name_mod-val

      tabbed-pane_theme_blue
      tabbed-pane_theme_white

      tabbed-pane_size_s
      tabbed-pane_size_l

      button_size_s
      button_size_l




70
Block files structure


      blocks/

        tabbed-pane.css
        tabbed-pane__tab.css
        tabbed-pane__pane.css
        tabbed-pane_theme_blue.css
        tabbed-pane_theme_black.css
        tabbed-pane_direction_bottom.css



71
Taken when necessary
                                                        CSS

      @import url(blocks/header.css);
      @import url(blocks/search.css);
      @import url(blocks/tabbed-pane.css);
      @import url(blocks/tabbed-pane__tab.css);
      @import url(blocks/tabbed-pane__pane.css);
      @import url(blocks/tabbed-pane_theme_blue.css);
      @import url(blocks/button.css);
      @import url(blocks/logo.css);
      @import url(blocks/footer.css);



72
Modifiers for elements




73
Taken when necessary
                                                           CSS

      <div class="tabbed-pane">
        <span class="
              tabbed-pane__tab
              tabbed-pane__tab_state_current">...</span>
      </div>




74
Block modifier DO affects elements




75
Cascade is possible
                                  CSS

      .tabbed-pane_theme_blue
      .tabbed-pane__tab
      {
        background-color: #9CF;
      }




76
Block File Structure
File structure. The flat case

      blocks/

        tabbed-pane.css               logo.css
        tabbed-pane__tab.css
        tabbed-pane__pane.css         search.css
        tabbed-pane_theme_blue.css    search__checkbox.css
        tabbed-pane_theme_black.css   search__autocomplete.css
        tabbed-pane_size_l.css
        tabbed-pane_size_s.css

        menu.css
        menu__item.css
        menu_size_l.css
        menu_size_s.css


78
File structure. Block folder

      blocks/

        tabbed-pane/                    menu/
          tabbed-pane.css                menu.css
          tabbed-pane__tab.css           menu__item.css
          tabbed-pane__pane.css          menu_size_l.css
          tabbed-pane_theme_blue.css     menu_size_s.css
          tabbed-pane_theme_black.css
          tabbed-pane_size_l.css
          tabbed-pane_size_s.css        search/
                                          search.css
        logo/                             search__checkbox.css
          logo.css                        search__autocomplete.css



79
File structure. Yandex way

      blocks/

        tabbed-pane/
          __tab/
             _state/
               tabbed-pane__tab_state_current.css
             tabbed-pane__tab.css
          __pane/
             tabbed-pane__pane.css
          _theme/
             tabbed-pane_theme_blue.css
             tabbed-pane_theme_black.css
          tabbed-pane.css



80
BEM entities



     • Block
      – combined in different ways
      – included one into another
      – independent
     • Element
     • Modifier

81
BEM is



     • Methodology
      is a way of thinking when developing
     • Tools
      do monkey job for you
     • Block libraries
      make you develop faster and better



83
IE
Render to IE the things that are IE's
                                                       HTML

      <html>
       <head>
         <!--[if gt IE 7]><!-->
           <link rel="stylesheet" href="index.css">
         <!--<![endif]-->
         <!--[if lt IE 8]>
           <link rel=stylesheet href="index.ie.css">
         <![endif]-->
       </head>
       ...


85
Render to IE the things that are IE's
                                                       HTML

      <html>
       <head>
         <!--[if gt IE 7]><!-->
           <link rel="stylesheet" href="index.css">
         <!--<![endif]-->
         <!--[if lt IE 8]>
           <link rel=stylesheet href="index.ie.css">
         <![endif]-->
       </head>
       ...


86
CSS file for IE
                                                  CSS

      @import url(index.css);
      @import url(blocks/menu/menu.ie.css);
      @import url(blocks/button/button.ie.css);
      @import url(blocks/footer/footer.ie.css);




87
CSS file for IE
                                                  CSS

      @import url(index.css);
      @import url(blocks/menu/menu.ie.css);
      @import url(blocks/button/button.ie.css);
      @import url(blocks/footer/footer.ie.css);




88
Block files for IE

      blocks/

        tabbed-pane/
          tabbed-pane.css
          tabbed-pane.ie.css
          ...

        menu/
         menu.css
         menu.ie.css


89
Element files for IE

      blocks/

        tabbed-pane/
          tabbed-pane.css
          tabbed-pane.ie.css
          tabbed-pane__item.css
          tabbed-pane__item.ie.css
          tabbed-pane_theme_blue.css
          tabbed-pane_theme_blue.ie.css



90
Block encapsulates all
                                             index.css
     blocks/
       menu/                  @import...
         menu__item.css       @import...
         menu__item.ie.css    @import...
         menu.css             @import...
         menu.ie.css          @import...
                              @import...



                                           index.ie.css
                              @import...
                              @import...
                              @import...
                              @import...
                              @import...
                              @import...


91
JavaScript
Tabbed-pane block




94
Dropdown block




95
Dropdown block




96
Page with JavaScript
                                                           index.html

      <!DOCTYPE html>
      <html>
       <head>
           <link rel=stylesheet href="index.css">
           <script type="text/javascript" src="all.js"/>
       </head>
       ...




97
Page with JavaScript
                                                         index.html

      <!DOCTYPE html>
      <html>
       <head>
           <link rel=stylesheet href="index.css">
           <script type="text/javascript" src="index.js"/>
       </head>
       ...




98
Pages are sets of blocks
           index page   search page   contacts page




99
JavaScript for blocks




       blocks/
         menu/
           menu.css
           menu.js
         dropdown/
           dropdown.css
           dropdown.js
         tabbed-pane/
           tabbed-pane.css
           tabbed-pane.js

100
Page JavaScript of blocks
                                                             index.js

       borschik:include:blocks/menu/menu.js
       borschik:include:blocks/tabbed-pane/tabbed-pane.js
       ...

                                                             index.js

       /* Menu block begins */
       (function($){
           $('.menu__item').on('click', function(e) {
               $(this).toggleClass('menu__item_state_current');
           });
       })(jQuery)

101
Borschik — CSS&JS flattening




                        git.io/borschik



102
CSS flatenning
                                          index.css

       @import url(blocks/header.css);
       @import url(blocks/menu.css);
       ...

                                         _index.css

       .header {
         ...
       }
       .menu {
         ...
       }

103
Relative paths in CSS
                           pages/index.css            blocks/menu/menu.css
      @import url(blocks/menu/menu.css);       .menu {

                                               background: url(menu__bg.png);

                                               }




                                                           pages/_index.css
      .menu {

      background: url(../blocks/menu/menu__bg.png);

      }


104
general CSS
      HTML
                                                @import url(blocks/head/head.css);
      <!DOCTYPE html>                           @import url(blocks/search/search.css);
      <html>                                    @import url(blocks/layout/layout.css);
        <head>                                  @import url(blocks/menu/menu.css);
          <title>Awesome online bookshop</title> url(blocks/text/text.css);
                                                @import
          <link rel="stylesheet" href="style.css"/>
                                                @import url(blocks/foot/foot.css);
          <script type="text/javascript" src="magic.js"></script>
        </head>
        <body>                                                      CSS for IE
          <div class="head">
             <ul class="menu">                                       @import url(index.css);
                <li class="menu__item"><a href="/">Home</a></li>     @import url(blocks/menu/menu.ie.css);
                <li class="menu__item"><a href="/news">News</a></li> url(blocks/text/text.ie.css);
                                                                     @import
                ...                                                  @import url(blocks/foot/foot.ie.css);
             </ul>
                                        JavaScript
             <div class="phone">+3 71 1234567</div>
         </div>
                                         (function($){
         <div class="layout">
            ...
                                            $('.menu__item').on('click', function() {
         </div>
        </body>
                                               $(this).toggleClass('menu__item_state_current');
      </html>
                                           });
                                       })(jQuery)

105
Building Page Files
Page declaration
                                           index.xml

       <b:page>
         <b:head>
             <b:logo/>
             <b:search>
               <e:input/>
               <e:button/>
             </b-search>
             <b:menu>
               <e:item>Home</e:item>
               <e:item>Contacts</e:item>
         ...

108
Page declaration. BEM tree
                                    index.bemjson

       {
           block: 'page',
           content: [
            {
              block: head,
              content: [
               { block: 'logo' },
               {
                 block: 'search',
                 ....


109
Change BEM tree if you need changes




                  }
                        page.html
                        page.css
                        page.js


110
BEM tools build pages with blocks




      git.io/bem-tools


111
BEM tools support many technologies

       blocks/                  pages/

         menu/                  index.html
          menu.sass             index.sass -> index.css
          menu.less             index.coffee -> index.js
          menu.coffee

         tabbed-pane/
           tabbed-pane.sass
           tabbed-pane.coffee


112
BEM tools support any file structure

       blocks/                         blocks/

         menu.css                        menu/
         menu_theme_black.css             __item/
         menu_theme_blue.css                menu__item.css
         menu_size_l.css                  _theme/
         menu_size_s.css                    menu_theme_black.css
         menu-item.css                      menu_theme_blue.css
         menu-item_state_current.css      _size/
                                            menu_size_l.css
         tabbed-pane.css                    menu_size_s.css
         tabbed-pane_theme_black.css      menu.css
         tabbed-pane_theme_blue.css
         tabbedpane-item.css           tabbed-pane/
         tabbedpane-pane.css
                                       logo/
         logo.css

113
Multilingual
BEM tools support custom technologies

       blocks/

         menu/
          tabbed-pane.css
          tabbed-pane.js
          tabbed-pane.md




115
BEM tools support custom technologies

       blocks/

         menu/
          tabbed-pane.css
          tabbed-pane.js
          tabbed-pane.md
          tabbed-pane.xsl




116
Gruelling race... every day
BEMHTML template engine

       blocks/

         menu/
          tabbed-pane.css
          tabbed-pane.js
          tabbed-pane.md
          tabbed-pane.bemhtml




118
BEMHTML reference [RU]




      bit.ly/bemhtml-doc-raw


119
Libraries
Block libraries




121
BEM block library




      bit.ly/bem-bl-site


122
Block page and block examples




123
Block code on GitHub




124
Libraries with BEM stack




          git.io/bootstrap-bl
          git.io/jqueryui-bl
          git.io/modernizr-bl

125
Wanna try?
BEM-based project




      git.io/bem-project-stub


127
Dev Tools
Borschik — CSS & JS flattening




                        git.io/borschik



129
CSS Optimizer


                                   BEFORE                                AFTER
       .test1 {                             .test1, .test2 {
          border: none;                        border: none
          background-color: red;            }

      bem.info/tools/csso
       }
                                            .test1, .test3 {
       .test2 {                                background-color: #F00;
          border: none                      }
       }

       .test3 {
          background-color: #FF000;
       }


130
SVG Optimizer




      git.io/svgo


131
http://bem.info
132
Varvara Stepanova
     Vladimir Varankin
     Frontend developers



     toivonen@yandex-team.ru
     varankinv@yandex-team.ru
     @toivonens
     @tvii

     @bem_tw


Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
Ifi7174 lesson1
Ifi7174 lesson1Ifi7174 lesson1
Ifi7174 lesson1Sónia
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 
What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)shinobu tsutsui
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic templatevathur
 
Workflow Essentials for Web Development
Workflow Essentials for Web DevelopmentWorkflow Essentials for Web Development
Workflow Essentials for Web DevelopmentXavier Porter
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsMark Rackley
 
Decoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSDecoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSJulie Cameron
 
Intro to CSS Selectors in Drupal
Intro to CSS Selectors in DrupalIntro to CSS Selectors in Drupal
Intro to CSS Selectors in Drupalcgmonroe
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery EssentialsMark Rackley
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setupvkeeton
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSLi-Wei Lu
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersDarren Gideon
 

Was ist angesagt? (20)

Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Ifi7174 lesson1
Ifi7174 lesson1Ifi7174 lesson1
Ifi7174 lesson1
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic template
 
Workflow Essentials for Web Development
Workflow Essentials for Web DevelopmentWorkflow Essentials for Web Development
Workflow Essentials for Web Development
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
 
Decoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSDecoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSS
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Intro to CSS Selectors in Drupal
Intro to CSS Selectors in DrupalIntro to CSS Selectors in Drupal
Intro to CSS Selectors in Drupal
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
jQuery besic
jQuery besicjQuery besic
jQuery besic
 
Unit 3 (it workshop).pptx
Unit 3 (it workshop).pptxUnit 3 (it workshop).pptx
Unit 3 (it workshop).pptx
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setup
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI Developers
 

Andere mochten auch

[전파교육] css day 2014
[전파교육] css day 2014[전파교육] css day 2014
[전파교육] css day 2014Kyoung Hwan Min
 
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-bl
Использование библиотеки bem-blИспользование библиотеки bem-bl
Использование библиотеки bem-blVarya Stepanova
 
Hvordan fungerer en søkemotor
Hvordan fungerer en søkemotorHvordan fungerer en søkemotor
Hvordan fungerer en søkemotorFINN.no
 
Sistemes informatics
Sistemes informaticsSistemes informatics
Sistemes informaticsEilaRuiz
 
0313 Walden Newsletter
0313 Walden Newsletter0313 Walden Newsletter
0313 Walden Newsletterkk1200
 

Andere mochten auch (20)

[전파교육] css day 2014
[전파교육] css day 2014[전파교육] css day 2014
[전파교육] css day 2014
 
CSS3
CSS3CSS3
CSS3
 
CSS
CSSCSS
CSS
 
BEM methodology overview
BEM methodology overviewBEM methodology overview
BEM methodology overview
 
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)
 
Basic css
Basic cssBasic css
Basic css
 
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
 
Modular development
Modular developmentModular development
Modular development
 
Использование библиотеки bem-bl
Использование библиотеки bem-blИспользование библиотеки bem-bl
Использование библиотеки bem-bl
 
Hvordan fungerer en søkemotor
Hvordan fungerer en søkemotorHvordan fungerer en søkemotor
Hvordan fungerer en søkemotor
 
Web app
Web appWeb app
Web app
 
Session 3 - Tech Enablers
Session 3 - Tech EnablersSession 3 - Tech Enablers
Session 3 - Tech Enablers
 
Sistemes informatics
Sistemes informaticsSistemes informatics
Sistemes informatics
 
0313 Walden Newsletter
0313 Walden Newsletter0313 Walden Newsletter
0313 Walden Newsletter
 

Ähnlich wie BEM. What you can borrow from Yandex frontend dev

Maintainable Frontend Development with BEM
Maintainable Frontend Development with BEMMaintainable Frontend Development with BEM
Maintainable Frontend Development with BEMVarya Stepanova
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePointMarc D Anderson
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Doing it in style - creating beautiful sites, the web standards way / WebDD /...Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Doing it in style - creating beautiful sites, the web standards way / WebDD /...Patrick Lauke
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyDenise Jacobs
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS TroubleshootingDenise Jacobs
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4imdurgesh
 
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...Scrum Breakfast Vietnam
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2James Pearce
 
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jqueryDanilo Sousa
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LAJake Johnson
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass UpMina Markham
 

Ähnlich wie BEM. What you can borrow from Yandex frontend dev (20)

Maintainable Frontend Development with BEM
Maintainable Frontend Development with BEMMaintainable Frontend Development with BEM
Maintainable Frontend Development with BEM
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 
The Thinking behind BEM
The Thinking behind BEMThe Thinking behind BEM
The Thinking behind BEM
 
HTML5 & CSS3 Flag
HTML5 & CSS3 FlagHTML5 & CSS3 Flag
HTML5 & CSS3 Flag
 
Fewd week2 slides
Fewd week2 slidesFewd week2 slides
Fewd week2 slides
 
Jquery 5
Jquery 5Jquery 5
Jquery 5
 
Bootstrap [part 2]
Bootstrap [part 2]Bootstrap [part 2]
Bootstrap [part 2]
 
Creative Web 2 - CSS
Creative Web 2 - CSS Creative Web 2 - CSS
Creative Web 2 - CSS
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Doing it in style - creating beautiful sites, the web standards way / WebDD /...Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & Efficiency
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4
 
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jquery
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass Up
 

Mehr von Varya Stepanova

Design systems on the web
Design systems on the webDesign systems on the web
Design systems on the webVarya Stepanova
 
SC5 Style Guide Generator
SC5 Style Guide GeneratorSC5 Style Guide Generator
SC5 Style Guide GeneratorVarya Stepanova
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEMVarya Stepanova
 
BEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodologyBEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodologyVarya Stepanova
 
Тема для WordPress в БЭМ
Тема для WordPress в БЭМТема для WordPress в БЭМ
Тема для WordPress в БЭМVarya Stepanova
 
Шаблонизатор BEMHTML
Шаблонизатор BEMHTMLШаблонизатор BEMHTML
Шаблонизатор BEMHTMLVarya Stepanova
 
JavaScript в БЭМ терминах
JavaScript в БЭМ терминахJavaScript в БЭМ терминах
JavaScript в БЭМ терминахVarya Stepanova
 
Использование библиотеки bem-bl
Использование библиотеки bem-blИспользование библиотеки bem-bl
Использование библиотеки bem-blVarya Stepanova
 

Mehr von Varya Stepanova (8)

Design systems on the web
Design systems on the webDesign systems on the web
Design systems on the web
 
SC5 Style Guide Generator
SC5 Style Guide GeneratorSC5 Style Guide Generator
SC5 Style Guide Generator
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM
 
BEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodologyBEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodology
 
Тема для WordPress в БЭМ
Тема для WordPress в БЭМТема для WordPress в БЭМ
Тема для WordPress в БЭМ
 
Шаблонизатор BEMHTML
Шаблонизатор BEMHTMLШаблонизатор BEMHTML
Шаблонизатор BEMHTML
 
JavaScript в БЭМ терминах
JavaScript в БЭМ терминахJavaScript в БЭМ терминах
JavaScript в БЭМ терминах
 
Использование библиотеки bem-bl
Использование библиотеки bem-blИспользование библиотеки bem-bl
Использование библиотеки bem-bl
 

BEM. What you can borrow from Yandex frontend dev

  • 1.
  • 2. BEM What you can borrow from Yandex frontend dev Frontend developer Varvara Stepanova
  • 3.
  • 4.
  • 5. Over 80 services • search – web pages – images, video – goods, news, blog posts, people • web mail • web maps – traffic jams, wiki maps, taxi • hosting and sharing – files, photos, video 5
  • 6. Inside Yandex • 2500 developers • 150+ frontend developers 6
  • 7. Dark side of the Force
  • 8. Programming is a team work
  • 10. We do enjoy sharing
  • 12.
  • 13. Behind the page HTML <!DOCTYPE html> <html> <head>...</head> <body> ... </body> CSS body { font: 0.8em Arial, sans-serif; margin: 0; color: black; } .sidebar ul li { 13
  • 14.
  • 15.
  • 16.
  • 17. Block
  • 18.
  • 19.
  • 20. Menu block HTML <ul class="menu"> <li><a href="/new">New titiles</a></li> <li><a href="/soon">Coming soon</a></li> <li><a href="/best">Bestsellers</a></li> ... CSS .menu { list-style: none; 20
  • 21. Search block HTML <div class="search"> <input type="text" name="search" value="..."/> <input type="button" name="sbmt" value="Search"/> </div> CSS .search { padding: 2em 0; 20 21
  • 22. Tabbed pane block HTML <div class="tabbed-pane"> <ul> <li>Bestsellers</li><li>...</li> </ul> <div> The Casual Vacancy, J.K. Rowling </div> </div> CSS .tabbed-pane { margin: 0.5em; ... } 22
  • 24. The page of blocks index.html <!DOCTYPE html> <html> <head>..</head> <body> <div class="head"> <div class="logo">...</div> <ul class="menu">...</ul> <div class="search">...</div> </div> <div class="layout">...</div> <div class="foot">...</div> </body> </html> 24
  • 26.
  • 27. Menu block HTML HTML <ul id="menu"> <ul class="menu"> ... ... CSS CSS #menu { .menu { ... ... 27
  • 28. Block is independent, if • a block has its "name" – no "id" but "classname" selectors • avoids cascade • no "tag" selectors 28
  • 30.
  • 31. Block is independent, if • a block has its "name" – no "id" but "classname" selectors • avoid cascade • no "tag" selectors 31
  • 32. almost NO CASCADE when using Cascading Style Sheets 32
  • 33.
  • 34.
  • 35.
  • 37.
  • 38.
  • 39.
  • 40. Pages are sets of blocks index page search page contacts page 40
  • 41. CSS for different pages common.css index.css style.css contacts.css body { ... } body { { } .advert... ... } body .phone { .head { .. } ... .head { ... } .head ul li { ... .layout .books} { } a:link, ... { ... } ... .head ul li { .advert { ... } } .phone a { ... .layout .books { ... } ... } body .phone { ... } } .phone a { ... } a:link, ... { #map { ... } #map { } } 41
  • 42.
  • 43.
  • 44. Pages are sets of blocks index page search page contacts page 44
  • 45. CSS for every block blocks/ header.css menu.css button.css tabbed-pane.css logo.css footer.css 45
  • 46. CSS for a page index.css @import url(blocks/header.css); @import url(blocks/menu.css); @import url(blocks/tabbed-pane.css); @import url(blocks/text.css); @import url(blocks/logo.css); @import url(blocks/footer.css); ... 46
  • 47. Project file system blocks/ pages/ advert.css index.html books-list.css index.css head.css foot.css contacts.html logo.css contacts.css menu.css search.css book.html tabbed-pane.css book.css 47
  • 48. WE NEED TO GO DEEPER
  • 50. Menu block HTML <ul class="menu"> <li><a href="/new">New titles</a></li> <li><a href="/soon">Coming soon</a></li> <li><a href="/best">Bestsellers</a></li> ... </ul> 50
  • 51. Menu block blocks/menu.css .menu li { list-style: none; display: inline-block; padding: 0 0.5em; } 51
  • 52. Menu and Dropdown blocks blocks/menu.css pages/index.html .menu li <li> { <a href="#">Bestsellers</a> list-style: none; <div class="dropdown"> display: inline-block; padding: 0 0.5em; <ul> } <li>Item One</li> <li>Item Two</li> <li>The best item</li> <li>Item Three</li> 52
  • 53. Block is independent, if • a block has its "name" – no "id" but "classname" selectors • avoid cascade • no "tag" selectors 53
  • 54. The style system matches rules by starting with the key selector, then moving to the left (looking for any ancestors in the rule’s selector). David Hyatt, MDN mzl.la/UuwZql 54
  • 62. Menu page.html <ul class="menu"> <li class="menu__item"><a href="/">Index</a></li> <li class="menu__item"><a href="/new">New</a></li> <li class="menu__item"><a href="/offer">Special offer</a></li> <li class="menu__item"><a href="/shipping">Shipping</a></li> </ul> 62
  • 63. Menu blocks/menu.css .menu li .tabbed-pane__tab { list-style: none; display: inline-block; .block-element padding: 0 0.5em; .block--element } .block___element 63
  • 65. Files for elements blocks/ search.css menu.css search__checkbox.css menu__item.css search__autocomlete.css tabbed-pane.css book.css tabbed-pane__tab.css book__title.css tabbed-pane__pane.css book__image.css 65
  • 68. Modifier HTML <div class="tabbed-pane tabbed-pane_theme_blue"> <ul> <li class="tabbed-pane__tab">Tab 1</li> <li class="tabbed-pane__tab">Tab 2</li> </ul> <div class="tabbed-pane__pane"> ... </div> </div> 68
  • 69. Modifier HTML <div class="tabbed-pane tabbed-pane_theme_blue tabbed-pane_direction_bottom"> ... </div> <input class="button button_theme_black button_size_l" ... /> 69
  • 70. block-name_mod-name_mod-val tabbed-pane_theme_blue tabbed-pane_theme_white tabbed-pane_size_s tabbed-pane_size_l button_size_s button_size_l 70
  • 71. Block files structure blocks/ tabbed-pane.css tabbed-pane__tab.css tabbed-pane__pane.css tabbed-pane_theme_blue.css tabbed-pane_theme_black.css tabbed-pane_direction_bottom.css 71
  • 72. Taken when necessary CSS @import url(blocks/header.css); @import url(blocks/search.css); @import url(blocks/tabbed-pane.css); @import url(blocks/tabbed-pane__tab.css); @import url(blocks/tabbed-pane__pane.css); @import url(blocks/tabbed-pane_theme_blue.css); @import url(blocks/button.css); @import url(blocks/logo.css); @import url(blocks/footer.css); 72
  • 74. Taken when necessary CSS <div class="tabbed-pane"> <span class=" tabbed-pane__tab tabbed-pane__tab_state_current">...</span> </div> 74
  • 75. Block modifier DO affects elements 75
  • 76. Cascade is possible CSS .tabbed-pane_theme_blue .tabbed-pane__tab { background-color: #9CF; } 76
  • 78. File structure. The flat case blocks/ tabbed-pane.css logo.css tabbed-pane__tab.css tabbed-pane__pane.css search.css tabbed-pane_theme_blue.css search__checkbox.css tabbed-pane_theme_black.css search__autocomplete.css tabbed-pane_size_l.css tabbed-pane_size_s.css menu.css menu__item.css menu_size_l.css menu_size_s.css 78
  • 79. File structure. Block folder blocks/ tabbed-pane/ menu/ tabbed-pane.css menu.css tabbed-pane__tab.css menu__item.css tabbed-pane__pane.css menu_size_l.css tabbed-pane_theme_blue.css menu_size_s.css tabbed-pane_theme_black.css tabbed-pane_size_l.css tabbed-pane_size_s.css search/ search.css logo/ search__checkbox.css logo.css search__autocomplete.css 79
  • 80. File structure. Yandex way blocks/ tabbed-pane/ __tab/ _state/ tabbed-pane__tab_state_current.css tabbed-pane__tab.css __pane/ tabbed-pane__pane.css _theme/ tabbed-pane_theme_blue.css tabbed-pane_theme_black.css tabbed-pane.css 80
  • 81. BEM entities • Block – combined in different ways – included one into another – independent • Element • Modifier 81
  • 82.
  • 83. BEM is • Methodology is a way of thinking when developing • Tools do monkey job for you • Block libraries make you develop faster and better 83
  • 84. IE
  • 85. Render to IE the things that are IE's HTML <html> <head> <!--[if gt IE 7]><!--> <link rel="stylesheet" href="index.css"> <!--<![endif]--> <!--[if lt IE 8]> <link rel=stylesheet href="index.ie.css"> <![endif]--> </head> ... 85
  • 86. Render to IE the things that are IE's HTML <html> <head> <!--[if gt IE 7]><!--> <link rel="stylesheet" href="index.css"> <!--<![endif]--> <!--[if lt IE 8]> <link rel=stylesheet href="index.ie.css"> <![endif]--> </head> ... 86
  • 87. CSS file for IE CSS @import url(index.css); @import url(blocks/menu/menu.ie.css); @import url(blocks/button/button.ie.css); @import url(blocks/footer/footer.ie.css); 87
  • 88. CSS file for IE CSS @import url(index.css); @import url(blocks/menu/menu.ie.css); @import url(blocks/button/button.ie.css); @import url(blocks/footer/footer.ie.css); 88
  • 89. Block files for IE blocks/ tabbed-pane/ tabbed-pane.css tabbed-pane.ie.css ... menu/ menu.css menu.ie.css 89
  • 90. Element files for IE blocks/ tabbed-pane/ tabbed-pane.css tabbed-pane.ie.css tabbed-pane__item.css tabbed-pane__item.ie.css tabbed-pane_theme_blue.css tabbed-pane_theme_blue.ie.css 90
  • 91. Block encapsulates all index.css blocks/ menu/ @import... menu__item.css @import... menu__item.ie.css @import... menu.css @import... menu.ie.css @import... @import... index.ie.css @import... @import... @import... @import... @import... @import... 91
  • 93.
  • 97. Page with JavaScript index.html <!DOCTYPE html> <html> <head> <link rel=stylesheet href="index.css"> <script type="text/javascript" src="all.js"/> </head> ... 97
  • 98. Page with JavaScript index.html <!DOCTYPE html> <html> <head> <link rel=stylesheet href="index.css"> <script type="text/javascript" src="index.js"/> </head> ... 98
  • 99. Pages are sets of blocks index page search page contacts page 99
  • 100. JavaScript for blocks blocks/ menu/ menu.css menu.js dropdown/ dropdown.css dropdown.js tabbed-pane/ tabbed-pane.css tabbed-pane.js 100
  • 101. Page JavaScript of blocks index.js borschik:include:blocks/menu/menu.js borschik:include:blocks/tabbed-pane/tabbed-pane.js ... index.js /* Menu block begins */ (function($){ $('.menu__item').on('click', function(e) { $(this).toggleClass('menu__item_state_current'); }); })(jQuery) 101
  • 102. Borschik — CSS&JS flattening git.io/borschik 102
  • 103. CSS flatenning index.css @import url(blocks/header.css); @import url(blocks/menu.css); ... _index.css .header { ... } .menu { ... } 103
  • 104. Relative paths in CSS pages/index.css blocks/menu/menu.css @import url(blocks/menu/menu.css); .menu { background: url(menu__bg.png); } pages/_index.css .menu { background: url(../blocks/menu/menu__bg.png); } 104
  • 105. general CSS HTML @import url(blocks/head/head.css); <!DOCTYPE html> @import url(blocks/search/search.css); <html> @import url(blocks/layout/layout.css); <head> @import url(blocks/menu/menu.css); <title>Awesome online bookshop</title> url(blocks/text/text.css); @import <link rel="stylesheet" href="style.css"/> @import url(blocks/foot/foot.css); <script type="text/javascript" src="magic.js"></script> </head> <body> CSS for IE <div class="head"> <ul class="menu"> @import url(index.css); <li class="menu__item"><a href="/">Home</a></li> @import url(blocks/menu/menu.ie.css); <li class="menu__item"><a href="/news">News</a></li> url(blocks/text/text.ie.css); @import ... @import url(blocks/foot/foot.ie.css); </ul> JavaScript <div class="phone">+3 71 1234567</div> </div> (function($){ <div class="layout"> ... $('.menu__item').on('click', function() { </div> </body> $(this).toggleClass('menu__item_state_current'); </html> }); })(jQuery) 105
  • 107.
  • 108. Page declaration index.xml <b:page> <b:head> <b:logo/> <b:search> <e:input/> <e:button/> </b-search> <b:menu> <e:item>Home</e:item> <e:item>Contacts</e:item> ... 108
  • 109. Page declaration. BEM tree index.bemjson { block: 'page', content: [ { block: head, content: [ { block: 'logo' }, { block: 'search', .... 109
  • 110. Change BEM tree if you need changes } page.html page.css page.js 110
  • 111. BEM tools build pages with blocks git.io/bem-tools 111
  • 112. BEM tools support many technologies blocks/ pages/ menu/ index.html menu.sass index.sass -> index.css menu.less index.coffee -> index.js menu.coffee tabbed-pane/ tabbed-pane.sass tabbed-pane.coffee 112
  • 113. BEM tools support any file structure blocks/ blocks/ menu.css menu/ menu_theme_black.css __item/ menu_theme_blue.css menu__item.css menu_size_l.css _theme/ menu_size_s.css menu_theme_black.css menu-item.css menu_theme_blue.css menu-item_state_current.css _size/ menu_size_l.css tabbed-pane.css menu_size_s.css tabbed-pane_theme_black.css menu.css tabbed-pane_theme_blue.css tabbedpane-item.css tabbed-pane/ tabbedpane-pane.css logo/ logo.css 113
  • 115. BEM tools support custom technologies blocks/ menu/ tabbed-pane.css tabbed-pane.js tabbed-pane.md 115
  • 116. BEM tools support custom technologies blocks/ menu/ tabbed-pane.css tabbed-pane.js tabbed-pane.md tabbed-pane.xsl 116
  • 118. BEMHTML template engine blocks/ menu/ tabbed-pane.css tabbed-pane.js tabbed-pane.md tabbed-pane.bemhtml 118
  • 119. BEMHTML reference [RU] bit.ly/bemhtml-doc-raw 119
  • 122. BEM block library bit.ly/bem-bl-site 122
  • 123. Block page and block examples 123
  • 124. Block code on GitHub 124
  • 125. Libraries with BEM stack git.io/bootstrap-bl git.io/jqueryui-bl git.io/modernizr-bl 125
  • 127. BEM-based project git.io/bem-project-stub 127
  • 129. Borschik — CSS & JS flattening git.io/borschik 129
  • 130. CSS Optimizer BEFORE AFTER .test1 { .test1, .test2 { border: none; border: none background-color: red; } bem.info/tools/csso } .test1, .test3 { .test2 { background-color: #F00; border: none } } .test3 { background-color: #FF000; } 130
  • 131. SVG Optimizer git.io/svgo 131
  • 133. Varvara Stepanova Vladimir Varankin Frontend developers toivonen@yandex-team.ru varankinv@yandex-team.ru @toivonens @tvii @bem_tw Thank you