W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

Re: [csswg-drafts] [css-inline-3] initial-letters changing used, not computed font-size (#4988)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Wed, 17 Jun 2020 09:12:00 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-645255145-1592385119-sysbot+gh@w3.org>
I had to read that a few times but I think I see what you're aiming at. So you'd essentially redefine `font-size`, `baseline-shift`, `text-underline-offset` etc. to explicitly include the multiplier aspect of the font-size as part of their calculations, but most other properties (eg `margin-left`) would remain unchanged.

So based on some of the examples linked from #2040, if you wanted `"1st` as your _initial-letter_, with `st` super-scripted and keyed off the used font size, but the leading quote the same size as the paragraph size...

```css
p {
   font-size: 16px;
}
.initial {
    initial-letter: 3 3;
    width: 5em;
    margin-left: -5em;
}
.initial .quote {
    font-size: 16px;
    vertical-align: text-top;
}
sup {
    baseline-shift: 0.4em;
    font-size: 0.5em;
}
```
```html
<p>
 <span class="initial">
  <span class="quote">&lquo;</span>
  1<sup>st</sup>
 </span>
</p>
```
The units used in `sup` are multiplied by our new multiplier, because they're font-relative. But the units in `.quote` are not, because they're absolute.

Have I understood this correctly?

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4988#issuecomment-645255145 using your GitHub account
Received on Wednesday, 17 June 2020 09:12:02 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:28 UTC