Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions css/css-mixins/mixins/contents-rule.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,46 @@
assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
}, 'Empty @contents parameter does not crash');
</script>


<style>
@mixin --m8() {
@result {
@contents {
color: green;
}
}
}
#e8 {
@apply --m8;
}
</style>
<div id="e8">This text should be green.</div>
<script>
test(() => {
assert_equals(getComputedStyle(document.getElementById('e8')).color, 'rgb(0, 128, 0)');
}, '@apply with no block uses the @contents fallback');
</script>


<style>
@mixin --m9() {
@result {
@contents {
color: red;
}
}
}
#e9 {
color: green;
@apply --m9 {};
}
</style>
<div id="e9">This text should be green.</div>
<script>
test(() => {
assert_equals(getComputedStyle(document.getElementById('e9')).color, 'rgb(0, 128, 0)');
}, 'Empty @apply block suppresses the @contents fallback');
</script>
</body>
</html>
Loading