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