-
Notifications
You must be signed in to change notification settings - Fork 719
[css-inline-3] initial-letters changing used, not computed font-size #4988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Doing some testing with this, and it's not that simple. While changing the computed font size would fix the font-size for any superscript text (for example), it would break example 6 in particular from the css-inline-spec: p::first-letter {
initial-letters: 3;
color: red;
width: 5em;
text-align: right;
margin-left: -5em;
}
p {
margin-left: 5em;
} Here, the user wants "-5em" to be computed against the specified font size. |
Based on the discussion, seems like we should continue to say that the computed font-size is unaffected, and take @emilio’s suggestion of maintaining a multiplier, which will affect the used font size and other effects that key off of the used font size (which is a class of things we'll henceforth need to be more clear about). I think the only things that need to key off the used font size are going to be anything (other than actual Scanning through, looks like that list should include:
Some side effects:
|
Slight complication: #2040 |
Invent a "uem" unit for used font-size? Give it a special meaning in initial-letters only? |
@faceless2 If we could distinguish inherited font-size vs explicitly set font-size, maybe that would work? Like maybe:
(To help with terminology, we can say the "computed font size" is 1em, but the "used font size" is 1em×multiplier.) |
I had to read that a few times but I think I see what you're aiming at. So you'd essentially redefine So based on some of the examples linked from #2040, if you wanted 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;
} <p>
<span class="initial">
<span class="quote">&lquo;span>
1<sup>stsup>
span>
p> The units used in Have I understood this correctly? |
Not quite. |
The CSS Working Group just discussed The full IRC log of that discussion |
Uh oh!
There was an error while loading. Please reload this page.
An element used for
initial-letters
will have its used font-size adjusted based on the algorithm specified in css-inline-3. However its computed font size remains unchanged.This is a problem for any child of the "initial-letters" element that refers to the parent font size as part of a style property - for example, if a child sets
font-size: 0.5em
, it will be 50% of the font-size the parent would have been, had it not been an initial-letter.The letter "A" has a computed font-size of 60px. The letter "B" has a font-size and baseline-shift of 10px, instead of the 30px an author would expect. Anyone creating superscript text as part of an initial letter would encounter this issue.
This issue is migrated from item 6 in #4171. There was considerable discussion of this in the January 2020 F2F, which is listed in the minutes however no resolution was reached.
The text was updated successfully, but these errors were encountered: