Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lvl99/6570c4f465bb0ea6cc0c5a4221e91b01 to your computer and use it in GitHub Desktop.
Save lvl99/6570c4f465bb0ea6cc0c5a4221e91b01 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
// Import and apply the Toggleable Mixin Class to a specific class
.toggleable {
// Imports the mixin and its related mixins and variables
.ui-lvl99-toggleable(@ns: ~"toggleable");
// Initialise the default since we have no other modifications from the normal
.-toggleable-init-default();
}
// Let's do a parametric modification since spans should be displayed using `inline` or `inline-block`
span.toggleable {
.ui-lvl99-toggleable(@ns: ~"toggleable"; @-toggleable-display: ~"inline-block");
.-toggleable-init-default();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment