Created
April 7, 2017 13:57
-
-
Save lvl99/13aa612acf3d90d9372a8ba8549ad19f to your computer and use it in GitHub Desktop.
Object-oriented inspired composable LESS mixins. View the article on the blog: http://blog.lvl99.com
This file contains 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
// Class mixin which contain style definitions for `show` state | |
.-toggleable-class-show(@rules: {}) { | |
display: @-toggleable-display; | |
@rules(); | |
} | |
// Class mixin which contains style definitions for `hide` state | |
.-toggleable-class-hide(@rules: {}) { | |
display: none; | |
@rules(); | |
} | |
// State mixin to import and assign the `show` class definition | |
// to the component’s `show` state | |
.-toggleable-state-show(@rules: {}) { | |
&@{-toggleable-ns-class-show} { | |
.-toggleable-class-show(@rules); | |
} | |
} | |
// State mixin to import and assign the `hide` class definition | |
// to the component’s `hide` state | |
.-toggleable-state-hide(@rules: {}) { | |
&@{-toggleable-ns-class-hide} { | |
.-toggleable-class-hide(@rules); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment