-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path_f-context-align.scss
More file actions
44 lines (39 loc) · 949 Bytes
/
_f-context-align.scss
File metadata and controls
44 lines (39 loc) · 949 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@use "../01-abstract/variables" as *;
/**
* Align - Make a context align (editor / style)
*
* @author Nicolas Langle
*
* @param $value
* @param $suffix
*
* Examples :
* #{ context-align("wide") } .block#{ context-align() } {
* ... your css
* }
*
* return for style.scss :
* .block.alignwide {
* ... your css
* }
*
* return for editor.scss :
* [data-align="wide"] > .block {
* ... your css
* }
*
*/
$function-context-align-last-value: "";
@function context-align($value: null, $suffix: " > ") {
@if not $value {
@if ($entry-file-name == "style") {
@return ".align" + $function-context-align-last-value;
}
} @else {
$function-context-align-last-value: $value !global;
@if ($entry-file-name == "editor") {
@return "[data-align=\"" + $value + "\"]" + $suffix;
}
}
@return "";
}