| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>050 font shorthand</title>
- <style>
- html { font-size: 10px; }
- body { background: #ffffff; color: #202020; font-family: sans-serif; }
- #a { font: 20px/1 Verdana, sans-serif; }
- #b { font: bold 22px/1.4 monospace; }
- #c { font: italic 18px/1.2 Verdana; }
- #d { font-size: 24px; }
- </style>
- </head>
- <body>
- <h1>050 — font shorthand</h1>
- <p>A family token after the size must not erase the parsed size, and the
- line-height/weight/style tokens must survive.</p>
- <div id="a">A: 20px family</div>
- <div id="b">B: bold 22px mono</div>
- <div id="c">C: italic 18px</div>
- <div id="d">D: 24px longhand control</div>
- <div id="result" style="background: #ffc8c8; color: #000000; padding: 8px;
- margin-top: 12px; font-size: 18px;">checking...</div>
- <script>
- setTimeout(function () {
- function size(id) { return getComputedStyle(document.getElementById(id)).fontSize; }
- var a = size('a'), b = size('b'), c = size('c'), d = size('d');
- var ok = a === '20px' && b === '22px' && c === '18px' && d === '24px';
- var r = document.getElementById('result');
- if (r) {
- r.style.background = ok ? '#c8f0c8' : '#ffc8c8';
- r.textContent = (ok ? 'FONT-OK ' : 'FONT-FAIL ') +
- 'a=' + a + ' b=' + b + ' c=' + c + ' d=' + d;
- }
- }, 300);
- </script>
- </body>
- </html>
|