Skip to content

Instantly share code, notes, and snippets.

@studiomohawk
Forked from necolas/README.md
Created March 16, 2012 00:55

Revisions

  1. @necolas necolas revised this gist Mar 1, 2012. 1 changed file with 4 additions and 8 deletions.
    12 changes: 4 additions & 8 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Used to provide structural templates.
    ```
    t-template-name
    t-template-name--modifier-name
    t-template-name__element-name--element-modifier-name
    t-template-name__subcomponent-name--subcomponent-modifier-name
    ```

    **Examples**
    @@ -24,11 +24,6 @@ t-media__img
    t-media__img--large
    t-media__opt
    t-media__body
    t-header
    t-content
    t-sidebar
    t-footer
    ```

    ## State Components
    @@ -68,7 +63,7 @@ js-action-save
    js-ui-collapsible
    js-ui-dropdown
    js-ui-dropdown--control
    js-ui-dropdown--tray
    js-ui-dropdown--menu
    js-ui-carousel
    ```

    @@ -79,7 +74,8 @@ Could reuse the Template Component naming convention, for example:
    ```
    specific-name
    specific-name--modifier-name
    specific-name__element-name--element-modifier-name
    specific-name__subcomponent-name
    specific-name__subcomponent-name--subcomponent-modifier-name
    ```

    Or just let anything go.
  2. @necolas necolas revised this gist Mar 1, 2012. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -38,16 +38,16 @@ Used to indicate the state of a component
    **Pattern**

    ```
    s-state-type
    is-state-type
    ```

    **Examples**

    ```
    s-hidden
    s-collapsed
    s-expanded
    s-selected
    is-hidden
    is-collapsed
    is-expanded
    is-selected
    ```

    ## JavaScript Components
  3. @necolas necolas revised this gist Oct 24, 2011. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions html-example.html
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    <!-- what if we used more white-space around class values? does it make the code more readable and surface/separate the components among the rest of the info in the HTML? -->
    <!--
    What if we used more white-space around class values?
    Does it make the code more readable and surface/separate the components
    among the rest of the info in the HTML?
    -->

    <div class=" t-unit t-media ">
    <div class=" t-media__img ">
    @@ -7,7 +11,7 @@
    </a>
    </div>
    <form class=" t-media__opt js-action-rate ">
    <button class=" product-rating ">
    <button class=" product-rating " type="submit">
    <div class=" product-rating__panel ">
    <span class=" product-rating__points ">
    5
    @@ -22,7 +26,7 @@
    </button>
    </form>
    <div class=" t-media__body ">
    <h2 class="h2">
    <h2 class=" h2 ">
    <a href="#">Product title</a>
    </h2>
    <p>[content]</p>
  4. @necolas necolas created this gist Oct 24, 2011.
    85 changes: 85 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    ## Template Components

    Used to provide structural templates.

    **Pattern**

    ```
    t-template-name
    t-template-name--modifier-name
    t-template-name__element-name--element-modifier-name
    ```

    **Examples**

    ```
    t-icon
    t-icon--large
    t-btn
    t-btn--large
    t-media
    t-media__img
    t-media__img--large
    t-media__opt
    t-media__body
    t-header
    t-content
    t-sidebar
    t-footer
    ```

    ## State Components

    Used to indicate the state of a component

    **Pattern**

    ```
    s-state-type
    ```

    **Examples**

    ```
    s-hidden
    s-collapsed
    s-expanded
    s-selected
    ```

    ## JavaScript Components

    Used to provide JS-only hooks for a component. Can be used to provide a JS-enhanced UI or to abstract other JS behaviours.

    **Pattern**

    ```
    js-action-name
    ```

    **Examples**

    ```
    js-submit
    js-action-save
    js-ui-collapsible
    js-ui-dropdown
    js-ui-dropdown--control
    js-ui-dropdown--tray
    js-ui-carousel
    ```

    ## About theming Components

    Could reuse the Template Component naming convention, for example:

    ```
    specific-name
    specific-name--modifier-name
    specific-name__element-name--element-modifier-name
    ```

    Or just let anything go.
    35 changes: 35 additions & 0 deletions html-example.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    <!-- what if we used more white-space around class values? does it make the code more readable and surface/separate the components among the rest of the info in the HTML? -->

    <div class=" t-unit t-media ">
    <div class=" t-media__img ">
    <a href="#">
    <img class=" product-img " src="http://example.com" alt="">
    </a>
    </div>
    <form class=" t-media__opt js-action-rate ">
    <button class=" product-rating ">
    <div class=" product-rating__panel ">
    <span class=" product-rating__points ">
    5
    </span>
    <span class=" product-rating__label ">
    upvotes
    </span>
    </div>
    <strong class=" product-rating__action t-btn btn-normal ">
    Upvote
    </strong>
    </button>
    </form>
    <div class=" t-media__body ">
    <h2 class="h2">
    <a href="#">Product title</a>
    </h2>
    <p>[content]</p>
    <ul class=" t-uilist--hz ">
    <li><a class=" tag " href="#">tag name</a></li>
    <li><a class=" tag " href="#">tag name</a></li>
    <li><a class=" tag " href="#">tag name</a></li>
    </ul>
    </div>
    </div>