回答編集履歴
2
文書の改善
test
CHANGED
@@ -1,13 +1,29 @@
|
|
1
|
-
`unquote`関数と`#{}`を使用すれば実装できます。
|
1
|
+
~~`unquote`関数~~と`#{}`を使用すれば実装できます。
|
2
2
|
|
3
3
|
|
4
4
|
|
5
5
|
```scss
|
6
6
|
|
7
|
-
@if unquote("#{var(--align)} == center") {
|
7
|
+
//@if unquote("#{var(--align)} == center") {
|
8
|
+
|
9
|
+
// margin: 0 auto 5px;
|
10
|
+
|
11
|
+
//}
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
@if '#{var(--align)} == center' {
|
8
16
|
|
9
17
|
margin: 0 auto 5px;
|
10
18
|
|
11
19
|
}
|
12
20
|
|
13
21
|
```
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
追記
|
26
|
+
|
27
|
+
`#{}`だけだとコンパイル時にwarningが出るので`unquote`関数を使用したのですが、追記後のコードの方が簡単で恐らく一般的だと思います。
|
28
|
+
|
29
|
+
[参考URL](https://hacknote.jp/archives/46965/)
|
1
文書の改善
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
unquoteを使用
|
1
|
+
`unquote`関数と`#{}`を使用すれば実装できます。
|
2
2
|
|
3
3
|
|
4
4
|
|