-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathmixin-basic.html
More file actions
67 lines (67 loc) · 1.49 KB
/
mixin-basic.html
File metadata and controls
67 lines (67 loc) · 1.49 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
<!DOCTYPE html>
<html>
<head>
<title>CSS Mixins: Basic test</title>
<link rel="help" href="https://drafts.csswg.org/css-mixins-1/#defining-mixins">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@mixin --m1() { /* Will be overwritten. */
@result {
.cls {
color: red;
}
}
}
@mixin --m1() {
@result {
.cls {
color: green;
}
}
}
@mixin invalid-name() {
@result {
.cls {
color: red;
}
}
}
@mixin --missing-argument-list {
@result {
.cls {
color: red;
}
}
}
@mixin --missing-result1() {
.cls {
color: red;
}
}
@mixin --missing-result2() {
color: red;
}
@mixin --empty1() {}
@mixin --empty2() { @result {} }
div {
@apply --m1;
@apply invalid-name;
@apply --missing-argument-list;
@apply --missing-result1;
@apply --missing-result2;
@apply --empty1;
@apply --empty2;
}
</style>
</head>
<body>
<div><div class="cls" id="target">This text should be green.</div></div>
<script>
test(() => {
let target = document.getElementById('target');
assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
});
</script>
</body>
</html>