apply-within-mixin.html (798B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Mixins: Mixins depending on other mixins</title> 5 <link rel="help" href="https://drafts.csswg.org/css-mixins-1/#apply-rule"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <style> 9 @mixin --m1() { 10 &.a { 11 @apply --m2; 12 } 13 } 14 .c { 15 @apply --m1; 16 } 17 @mixin --m2() { 18 &.b { 19 color: green; 20 } 21 } 22 </style> 23 </head> 24 <body> 25 <div><div class="a b c" id="target">This text should be green.</div></div> 26 <script> 27 test(() => { 28 let target = document.getElementById('target'); 29 assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)'); 30 }); 31 </script> 32 </body> 33 </html>