mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
55 lines
1.2 KiB
SCSS
55 lines
1.2 KiB
SCSS
|
@use "sass:meta";
|
||
|
@use "sass:string";
|
||
|
@use "config";
|
||
|
|
||
|
/* BEM support Func
|
||
|
-------------------------- */
|
||
|
@function selectorToString($selector) {
|
||
|
$selector: meta.inspect($selector);
|
||
|
$selector: string.slice($selector, 2, -2);
|
||
|
@return $selector;
|
||
|
}
|
||
|
|
||
|
@function containsModifier($selector) {
|
||
|
$selector: selectorToString($selector);
|
||
|
|
||
|
@if string.index($selector, config.$modifier-separator) {
|
||
|
@return true;
|
||
|
} @else {
|
||
|
@return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@function containWhenFlag($selector) {
|
||
|
$selector: selectorToString($selector);
|
||
|
|
||
|
@if string.index($selector, '.' + config.$state-prefix) {
|
||
|
@return true;
|
||
|
} @else {
|
||
|
@return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@function containPseudoClass($selector) {
|
||
|
$selector: selectorToString($selector);
|
||
|
|
||
|
@if string.index($selector, ':') {
|
||
|
@return true;
|
||
|
} @else {
|
||
|
@return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@function hitAllSpecialNestRule($selector) {
|
||
|
@return containsModifier($selector) or containWhenFlag($selector) or
|
||
|
containPseudoClass($selector);
|
||
|
}
|
||
|
|
||
|
@function lightness($h, $s, $l, $lightness) {
|
||
|
@return hsl(var(#{$h}), var(#{$s}), calc(var(#{$l}) + #{$lightness}));
|
||
|
}
|
||
|
|
||
|
@function saturation($h, $s, $l, $saturation) {
|
||
|
@return hsl(var(#{$h}), calc(var(#{$s}) + #{$saturation}), var(#{$l}));
|
||
|
}
|