forked from sass/sass-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent_exists.hrx
More file actions
215 lines (183 loc) · 3.92 KB
/
content_exists.hrx
File metadata and controls
215 lines (183 loc) · 3.92 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<===> options.yml
---
:todo:
- sass/libsass#2938
<===>
================================================================================
<===> false/top_level/options.yml
---
:todo:
- libsass
<===> false/top_level/input.scss
@mixin a {
b {c: content-exists()}
}
@include a;
<===> false/top_level/output.css
b {
c: false;
}
<===>
================================================================================
<===> false/through_content/input.scss
@mixin call-content {
@content;
}
@mixin print-content-exists {
a {b: content-exists()}
}
@include call-content {
@include print-content-exists;
}
<===> false/through_content/output.css
a {
b: false;
}
<===>
================================================================================
<===> true/empty/input.scss
@mixin a {
b {c: content-exists()}
@content;
}
@include a {}
<===> true/empty/output.css
b {
c: true;
}
<===>
================================================================================
<===> true/non_empty/options.yml
---
:todo:
- libsass
<===> true/non_empty/input.scss
@mixin a {
b {c: content-exists()}
@content;
}
@include a {
d {e: f}
}
<===> true/non_empty/output.css
b {
c: true;
}
d {
e: f;
}
<===>
================================================================================
<===> controls/true/options.yml
---
:todo:
- sass/libsass#2842
<===> controls/true/input.scss
// Regression test for sass/libsass#2842
@mixin test-content-exists() {
@if content-exists() {
@content;
}
@else {
content-exists: false;
}
}
a {
@include test-content-exists() {
content: present;
}
}
<===> controls/true/output.css
a {
content: present;
}
<===>
================================================================================
<===> controls/false/options.yml
---
:todo:
- sass/libsass#2842
<===> controls/false/input.scss
// Regression test for sass/libsass#2842
@mixin test-content-exists() {
@if content-exists() {
@content;
}
@else {
content-exists: false;
}
}
a {
@include test-content-exists();
}
<===> controls/false/output.css
a {
content-exists: false;
}
<===>
================================================================================
<===> error/too_many_args/input.scss
@mixin a {
b {c: content-exists(1)}
}
@include a;
<===> error/too_many_args/error
Error: Only 0 arguments allowed, but 1 was passed.
,--> input.scss
2 | b {c: content-exists(1)}
| ^^^^^^^^^^^^^^^^^ invocation
'
,--> sass:meta
1 | @function content-exists() {
| ================ declaration
'
input.scss 2:9 a()
input.scss 4:1 root stylesheet
<===>
================================================================================
<===> error/outside_mixin/input.scss
a {b: content-exists()}
<===> error/outside_mixin/error
Error: content-exists() may only be called within a mixin.
,
1 | a {b: content-exists()}
| ^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet
<===>
================================================================================
<===> error/in_content/input.scss
@mixin call-content {
@content;
}
@include call-content {
a {b: content-exists()}
}
<===> error/in_content/error
Error: content-exists() may only be called within a mixin.
,
6 | a {b: content-exists()}
| ^^^^^^^^^^^^^^^^
'
input.scss 6:9 @content
input.scss 2:3 call-content()
input.scss 5:1 root stylesheet
<===>
================================================================================
<===> error/in_function_called_by_mixin/input.scss
@function call-content-exists() {
@return content-exists();
}
@mixin call-function {
a {b: call-content-exists()};
}
@include call-function;
<===> error/in_function_called_by_mixin/error
Error: content-exists() may only be called within a mixin.
,
2 | @return content-exists();
| ^^^^^^^^^^^^^^^^
'
input.scss 2:11 call-content-exists()
input.scss 6:9 call-function()
input.scss 9:1 root stylesheet