Last active
August 29, 2015 14:18
-
-
Save mndvns/872a202ddb0d9349a3a4 to your computer and use it in GitHub Desktop.
ESS constructor pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bg = props.bg | |
| var family = props.family | |
| background = bg || 'white' | |
| font-family = family || 'Arial' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .Foo { | |
| background: #fff | |
| } | |
| .Foo, .Bar { | |
| font-family: Arial | |
| } | |
| .Bar { | |
| background: purple | |
| } | |
| .Bazz { | |
| background: red; | |
| font-family: Helvetica; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Constructor from './constructor.ess?raw' | |
| .Foo | |
| Constructor | |
| .Bar | |
| Constructor(bg='purple') | |
| .Bazz | |
| Constructor(bg='red' family='Helvetica') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment