Skip to content

Instantly share code, notes, and snippets.

@cesarchavezcal
Forked from stephenway/README.md
Created August 31, 2017 14:33
Show Gist options
  • Save cesarchavezcal/95ad93f5593669508fde9177848af99b to your computer and use it in GitHub Desktop.
Save cesarchavezcal/95ad93f5593669508fde9177848af99b to your computer and use it in GitHub Desktop.

Revisions

  1. @stephenway stephenway revised this gist Oct 23, 2015. 1 changed file with 47 additions and 0 deletions.
    47 changes: 47 additions & 0 deletions postcss.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    ``` css
    /* Block Element */
    @mixin e element-name { }

    /* Block Modifier */
    @mixin m modifier-name { }

    /* Object */
    @mixin o object-name { }

    /* Component */
    @mixin c component-name { }

    /* Utility */
    @mixin u utility-name { }

    /* Theme */
    @mixin t theme-name { }

    /* Scope */
    @mixin s scope-name { }

    /* States */
    @mixin is state-name { }
    @mixin has state-name { }

    /* Hack */
    @mixin hack hack-name { }

    /* Javascript */
    @mixin js node-name { }

    /* Quality Assurance */
    @mixin qa node-name { }

    /* Small Styles */
    @mixin sm { }

    /* Medium Styles */
    @mixin md { }

    /* Large Styles */
    @mixiin lg { }

    /* Print Styles */
    @mixin print { }
    ```
  2. @stephenway stephenway created this gist Oct 9, 2015.
    84 changes: 84 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,84 @@
    # BEMIT Cheatsheet

    Give developers more knowledge about how the classes behave in a non-relative sense: BEM + ITCSS = BEMIT

    - [More Transparent UI Code with Namespaces](http://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/)
    - [BEMIT: Taking the BEM Naming Convention a Step Further](http://csswizardry.com/2015/08/bemit-taking-the-bem-naming-convention-a-step-further/)

    ## Evolution

    BEM:
    ```css
    .block__element--modifier {}
    ```

    BEM w/ Namespaces:
    ```css
    .namespace-block__element--modifier {}
    ```

    BEM w/ Namespaces & Responsive Suffixes:
    ```css
    .namespace-block__element--modifier\@suffix {}
    ```

    ## Namespaces

    Object
    ```css
    .o-object-name[<element>|<modifier>] {}
    ```

    Component
    ```css
    .c-component-name[<element>|<modifier>] {}
    ```

    Utility
    ```css
    .u-utility-name {}
    ```

    Theme
    ```css
    .t-theme-name {}
    ```

    Scope
    ```css
    .s-scope-name {}
    ```

    State
    ```css
    .[is|has]-state {}
    ```

    Hack
    ```css
    ._<namespace>hack-name {}
    ```

    Javascript
    ```css
    .js-component-name {}
    ```

    Quality Assurance
    ```css
    .qa-node-name {}
    ```

    ## Responsive Suffixes

    Breakpoints
    ```css
    .o-object-name\@sm {}
    .o-object-name\@md {}
    .o-object-name\@lg {}
    ```

    Media type
    ```css
    .u-utility-name\@print {}
    ```