Skip to content

Instantly share code, notes, and snippets.

@chrislloyd
Created August 19, 2015 22:56

Revisions

  1. chrislloyd created this gist Aug 19, 2015.
    22 changes: 22 additions & 0 deletions react-css-modules-example.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    function cssmodularize(strings) {
    /* TODO: Un-stub */
    return {
    '.foo': 'Button-foo-abcd'
    }
    }

    class Button {

    static styles = cssmodularize`
    .foo { /* ... */ }
    `

    render() {
    const s = this.constructor.styles
    console.log(s)
    // ...
    }
    }

    const button = new Button()
    button.render()