mixin-declarations.html (717B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Mixins: Declarations directly in mixin</title> 5 <link rel="help" href="https://drafts.csswg.org/css-mixins-1/#defining-mixins"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <style> 9 @mixin --m1() { 10 color: green; 11 } 12 div { 13 color: red; 14 @apply --m1; 15 } 16 </style> 17 </head> 18 <body> 19 <div><div class="cls" id="target">This text should be green.</div></div> 20 <script> 21 test(() => { 22 let target = document.getElementById('target'); 23 assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)'); 24 }); 25 </script> 26 </body> 27 </html>