text-underline-offset-calc.html (1252B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>text-underline-offset calc() support</title> 4 <link rel="author" title="Zak Ridouh" href="mailto:zakr@apple.com" /> 5 <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset" /> 6 <meta name="assert" content="Test checks whether text-underline-offset supports calc() values."> 7 <link rel="match" href="text-underline-offset-calc-ref.html"> 8 <style> 9 div { 10 display: flex; 11 font-size: 22px; 12 } 13 .underline { 14 text-decoration-color: green; 15 text-decoration-line: underline; 16 text-decoration-thickness: 15px; 17 text-decoration-skip-ink: none; 18 } 19 .ref { 20 text-underline-offset: 1em; 21 } 22 .test1 { 23 text-underline-offset: calc(1em); 24 } 25 .test2 { 26 text-underline-offset: calc(100%); 27 } 28 .test3 { 29 text-underline-offset: calc(50% + 11px); 30 } 31 .test4 { 32 text-underline-offset: calc(50% + 0.5em); 33 } 34 .test5 { 35 text-underline-offset: calc(0.5em + 11px); 36 } 37 </style> 38 <p>Test passes if black and green bar pairs are the same shape and size.</p> 39 <div> 40 <span class="underline ref">X</span> 41 <span class="underline test1">X</span> 42 <span class="underline test2">X</span> 43 <span class="underline test3">X</span> 44 <span class="underline test4">X</span> 45 <span class="underline test5">X</span> 46 </div>