bem.scss 458 B

12345678910111213141516171819202122232425262728293031323334
  1. @forward './constants';
  2. @mixin b($block) {
  3. $B: $namespace + '-' + $block !global;
  4. .#{$B} {
  5. @content;
  6. }
  7. }
  8. @mixin e($name) {
  9. @at-root {
  10. &#{$element-separator}#{$name} {
  11. @content;
  12. }
  13. }
  14. }
  15. @mixin m($name) {
  16. @at-root {
  17. &#{$modifier-separator}#{$name} {
  18. @content;
  19. }
  20. }
  21. }
  22. // block__element.is-active {}
  23. @mixin is($state, $prefix: $state-prefix) {
  24. @at-root {
  25. &.#{$prefix}-#{$state} {
  26. @content;
  27. }
  28. }
  29. }