Skip to content

Instantly share code, notes, and snippets.

@pascaliske
Last active May 17, 2018 22:57
Show Gist options
  • Save pascaliske/a6c393b2c1950d0949f6aaa557c4b809 to your computer and use it in GitHub Desktop.
Save pascaliske/a6c393b2c1950d0949f6aaa557c4b809 to your computer and use it in GitHub Desktop.
// ----
// libsass (v3.5.0.beta.2)
// ----
//
// GLOBAL
//
@mixin cmp-base($component) {
.#{$component} {
@content;
}
}
@mixin cmp-modifier($component, $modifier) {
.#{$component}--#{$modifier} .#{$component} {
@content;
}
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
/**
* COMPONENT "f-radiobox"
*/
$component: 'f-radiobox';
@include cmp-base($component) {
background: grey;
&__field {
background: white;
}
&__label {
color: black;
}
}
@include cmp-modifier($component, 'coloured') {
background: green;
&__field {
background: red;
}
&__label {
color: green;
}
}
/**
* COMPONENT "f-radiobox"
*/
.f-radiobox {
background: grey;
}
.f-radiobox__field {
background: white;
}
.f-radiobox__label {
color: black;
}
.f-radiobox--coloured .f-radiobox {
background: green;
}
.f-radiobox--coloured .f-radiobox__field {
background: red;
}
.f-radiobox--coloured .f-radiobox__label {
color: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment