mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
64 lines
1.0 KiB
SCSS
64 lines
1.0 KiB
SCSS
@import "./config.scss";
|
|
|
|
$B: null;
|
|
$BE: null;
|
|
|
|
@mixin b($block) {
|
|
$temp-block: $B;
|
|
$temp-block-element: $BE;
|
|
$B: $namespace + "-" + $block !global;
|
|
$BE: $B!global;
|
|
.#{$B} {
|
|
@content;
|
|
}
|
|
$B: $temp-block !global;
|
|
$BE: $temp-block-element !global;
|
|
}
|
|
|
|
@mixin e($elements...) {
|
|
$temp-block-element: $BE;
|
|
$BEs: '';
|
|
@each $element in $elements {
|
|
$BE: $B + "__" + $element !global;
|
|
.#{$BE} {
|
|
@content
|
|
}
|
|
}
|
|
$BE: $temp-block-element !global;
|
|
}
|
|
|
|
@mixin m($modifiers...) {
|
|
$BEMs: '';
|
|
@for $i from 0 to length($modifiers) {
|
|
$modifier: nth($modifiers, $i + 1);
|
|
@if $i == 0 {
|
|
$BEMs: '&.' + $BE + '--' + $modifier;
|
|
} @else {
|
|
$BEMs: $BEMs + ', &.' + $BE + '--' + $modifier;
|
|
}
|
|
}
|
|
#{$BEMs} {
|
|
@content
|
|
}
|
|
}
|
|
|
|
@mixin not-m($modifier) {
|
|
$BEM: '';
|
|
$BEM: '.' + $BE + '--' + $modifier;
|
|
&:not(#{$BEM}) {
|
|
@content
|
|
}
|
|
}
|
|
|
|
@mixin detachedContentWrapper {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
width: 0;
|
|
height: 0;
|
|
overflow: visible;
|
|
}
|
|
|
|
@mixin detachedContent {
|
|
position: fixed;
|
|
} |