Skip to content

Commit 8b46646

Browse files
committed
feat (Abstract scss) : add function align for gutenberg block
1 parent 4fa9c7f commit 8b46646

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/scss/abstract/_f-align.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Align
3+
*
4+
* exemples :
5+
*
6+
* #{ align("wide") } .block#{ align() } {
7+
* ... your css
8+
* }
9+
*
10+
* return for style.scss :
11+
* .block.alignwide {
12+
* ... your css
13+
* }
14+
*
15+
* return for editor-style.scss :
16+
* [data-align="wide"] > .block {
17+
* ... your css
18+
* }
19+
*
20+
*/
21+
22+
$function-align-last-value: "";
23+
24+
@function align($value: null, $suffix: " > ") {
25+
@if ($value == null) {
26+
@if ($entry-file-name == "style") {
27+
@return ".align" + $function-align-last-value;
28+
}
29+
} @else {
30+
$function-align-last-value: $value;
31+
32+
@if ($entry-file-name == "editor-style") {
33+
@return "[data-align=\"" + $value + "\"]" + $suffix;
34+
}
35+
}
36+
37+
@return "";
38+
}

0 commit comments

Comments
 (0)