Skip to content

Instantly share code, notes, and snippets.

Created October 21, 2013 17:29
Show Gist options
  • Save anonymous/7087676 to your computer and use it in GitHub Desktop.
Save anonymous/7087676 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.7)
// ----
/*
BLOCK__ELEMENT--MODIFIER function
*/
@import "compass";
@import "compass-placeholders";
@function BEM($block, $element: null, $modifier: null) {
@if $element == null {
@if $modifier == null {
@return #{$block}
}
@else {
@return #{$block}--#{$modifier}
}
}
@else {
@if $modifier == null {
@return #{$block}__#{$element}
}
@else {
@return #{$block}__#{$element}--#{$modifier}
}
}
}
/*
mypage.scss
*/
$BUTTON: BEM("modules-shared-atomic-components-button");
.#{BEM(#{$BUTTON}, null, "enabled")} {
opacity: 1;
}
.#{BEM(#{$BUTTON}, "text", "enabled")} {
opacity: 0.5;
}
/*
BLOCK__ELEMENT--MODIFIER function
*/
/*
mypage.scss
*/
.modules-shared-atomic-components-button--enabled {
opacity: 1;
}
.modules-shared-atomic-components-button__text--enabled {
opacity: 0.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment