Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 31 additions & 8 deletions sass/_bemify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@
// .block__element--is-active {}
$combined-state-selectors: true !default;

// Output combined modifier selectors like:
// .block__element.block__element--modifier {}
// Set to false to output single, non-combined modifier class:
// .block__element--modifier {}
$combined-modifier-selectors: false !default;

// .block[separator]element:
$element-separator: "__" !default;
$element-separator: '__' !default;

// .block[separator]modifier:
$modifier-separator: "--" !default;
$modifier-separator: '--' !default;

// The default prefix for state modifier selectors, will be combined with $modifier-separator:
$state-prefix: "is" !default;
$state-prefix: 'is' !default;

// The default prefix for section selectors, will be combined with the given $name
$section-prefix: 'section' !default;



Expand All @@ -48,9 +56,20 @@ $state-prefix: "is" !default;


@mixin modifier($name) {
@at-root {
&#{$modifier-separator}#{$name} {
@content;
@if $combined-modifier-selectors == true {
@at-root {
$self: &;

#{$self}#{$self}#{$modifier-separator}#{$name} {
@content;
}
}

} @else {
@at-root {
&#{$modifier-separator}#{$name} {
@content;
}
}
}
}
Expand All @@ -63,8 +82,7 @@ $state-prefix: "is" !default;
@content;
}
}
}
@else {
} @else {
@at-root {
&#{$modifier-separator}#{$prefix}-#{$state} {
@content;
Expand All @@ -74,6 +92,11 @@ $state-prefix: "is" !default;
}


@mixin section($name) {
@include block(#{$section-prefix}-#{$name}) {
@content;
}
}


// ALIASES
Expand Down