aboutsummaryrefslogtreecommitdiffstats
path: root/src/bem/_functions.scss
blob: b7bd5ecad54918313a853834b968444f21fe46cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
////
/// @group BEM
///
/// @access public
////

@use './vars';

///
/// @access private
///
@function theme-selector($name, $names...) {
    $namespace: map-get(vars.$namespaces, 'theme');
    $selector:  null;

    @each $name in join($name, $names) {
        $sel: '.' + $namespace + '-' + $name;

        @if $selector == null {
            $selector: join(selector-parse($sel), selector-parse('[class*=\' t-\'] ' + $sel), comma);
            $selector: join($selector, selector-parse('[class^=\'t-\'] ' + $sel), comma);
        } @else {
            $selector: selector-nest($selector, $sel);
        }
    }

    @return $selector;
}