You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-inline] better name for initial-letters property #2950
People have been confused that the initial-letters property sounds more like a selector than a property that changes the rendering of text. Let the bikeshedding begin!
It seems the crux of the problem is that Initial Letter (a graphic design term, used along with Drop Cap, where Initial means big text that sits on the baseline and rises above the rest of the text, where Drop Cap drops down into the text) — the word "Initial" in graphic design is a noun. And yet, when it's used in CSS, it seems like an adjective.
I agree with @astearns about using initials, and I like the idea of using span. I'll suggest initial-decoration as a binary with initial-span as a numeric variable.
initial-decoration could also have a list of values initial-decoration: 1 4 600 to correspond to chars, vertical-size(is this initial span), font-weight
Unless the plan is to extend this property to apply beyond first child or first pseudo-element in a block, I think it is useful to preserve the initial- (or initials-) prefix for the properties.
However, I agree that the suffix -letter (or -letters, as it is currently spec'd) does not make sense for the primary property, which isn't defining a letter to use, it's defining a number of lines to span and to drop.
I would argue against the following suggestions:
lettrine, versals : obscure terms. I'd have no idea what these words meant if they weren't part of this discussion. I'd probably have a hard time remembering how to spell either, and my browser dictionary tells me that the correct spellings are incorrect.
-ornaments, -decoration: imply something added to the text, not just text sizing changes.
dropcap: implies that the "dropping" part is essential. (And maybe isn't very easily translated to languages that don't have capitalization?)
line-span: would be nice if the property actually applied to any element (like a floated image), but it doesn't communicate the "initial" restrictions in the spec. And line-span-align, line-span-wrap are just confusing.
I think initial(s)-line-span is clear, if long. Or initials-span, with the s required to prevent span from being read as a noun. Alternatives: initials-scale or initials-expansion, but those don't cover the "drop" half of the property as effectively.
The other properties would just be initials-align, initials-wrap.
(Sadly, there is no potential for an initials shorthand so long as the alignment properties are inherited and the sizing one is not. If there was an interest in changing the inheritance to create an overall shorthand, though, then the main property could be decomposed into initial-scale vs initial-drop, where -drop has auto as a default.)
Found this conversation via Jen Simmon's tweet. Here to provide a bit of context on how we approached drop caps in old-school (pre-internet) typography, and hopefully to help guide this discussion a bit from that context.
Selector
Drop-caps (or Versals) were a property of paragraph styles, generally denoting the first paragraph in a chapter or section.
In this case, the selector wouldn't apply to just the first letter of a paragraph, but it should be a property of a span or a block level element (p, or div), and could be applied with p:first-child, p:first-of-type, p:nth-child(), etc.
Properties
Versals generally had two parameters:
Number of characters: (First (n) character(s) in a paragraph, or first (n) word(s)) in a paragraph
Character Height: How many lines did the Versal(s) take up.
Relevant to this discussion:
In this case, this seems to be a property that's being applied to the existing ::first-letter pseudo element, which makes the "number of characters" parameter moot.
Looking at this fresh, I feel like we are struggling to make initial work in any sort of way, and it's just not working. CSS Properties are descriptive of the change that the property will make (like font-size), and not of the motivation for making the change (not 'readable-type). Initial ends up sounding like an adjective, and gets easily confused with first-letter`. It doesn't come across as a noun.
I like what line-span does — it describes the context, affecting lines, and the result, setting a span across several lines. But as many have argued, span could be easily confused with its other meanings in HTML & CSS.
What if we try to find other words to do what line-span would do. Synonyms for "span" include:
interval
length
period
space
spell
stretch
term
amount
compass
extent
measure
reach
spread
time
line-spread? line-reach? character-spread?
???
Then you'd end up with character-spread-align character-spread-wrap
or line-reach-align line-reach-wrap
or something down this road...
Don't go with character-*. "character" suggests the inline (horizontal) direction whereas "line" suggests the block (vertical) direction.
This property is all about the vertical/block direction so we should use line-*. Whatever the name ends up being the first word of that name should be "line".
Out of the possible second words you provided, I like these possibilities:
line-span: would be nice if the property actually applied to any element (like a floated image), but it doesn't communicate the "initial" restrictions in the spec.
@Dan503 I think resorting to the use of a generic line- prefix will always leave authors wanting. Especially when we've already taught them line-height as something that doesn't solely apply to these "initial letters".
The CSS Working Group just discussed better name for initial-letters property.
The full IRC log of that discussion
<dael> Topic: better name for initial-letters property
<dael> github: https://github.com//issues/2950#issuecomment-438736819
<dael> jensimmons: As issue says we're debating a name. Kinda hit me is a way to approach is desc what this does. I wrote some stuff, but I disagree with myself.
<dael> jensimmons: Right now I'm thinking maybe line-span is a poss. I originally rejected because span is in the html, but there's em in html and em unit in CSS and that's never confused.
<dael> fantasai: Okay with that
<dael> jensimmons: Made me wonder if you can do more than make a letter big. Like if you had an image would it do anything?
<dael> fantasai: Yes, if you apply to an atomic element it will apply. There is text on how this works with inline blocks and images.
<dael> astearns: Def. intended to work in that case
<dael> fantasai: I think that was my favorite from the list
<dael> astearns: Other opinions?
<dael> dauwhe: Plausable to me
<AmeliaBR> But to clarify: it still only applies to the first element of a block? So that's the bit that isn't conveyed by the name.
<dael> bradk: line-span makes it sound like it would be any inline element and it would span the line. That was my concern
<dael> jensimmons: Agree we need to think about that
<dael> astearns: Table this for now and get to it at F2F. Let's try and get to this on the first day to make sure we give it needed time
Activity
jensimmons commentedon Jul 25, 2018
I dropped a question about this on Twitter, to see what people might say:
https://twitter.com/jensimmons/status/1022155415239450625
It seems the crux of the problem is that Initial Letter (a graphic design term, used along with Drop Cap, where Initial means big text that sits on the baseline and rises above the rest of the text, where Drop Cap drops down into the text) — the word "Initial" in graphic design is a noun. And yet, when it's used in CSS, it seems like an adjective.
Ideas (first mine, second from Twitter):
p::first-letter { initial: 5; }
p::first-letter { initial: 5 1; }
p::first-letter { line-span: 4; }
I wonder how
line-spanworks in the world of words block, inline, span…dauwhe commentedon Jul 25, 2018
Wikipedia uses initial, which is probably the most accurate term in English.
Something about line-span makes me worry about confusion with the html element
jensimmons commentedon Jul 25, 2018
I dropped this into a Slack channel and got a variety of suggestions:
This discussion raised questions like "What about characters? Does it have to be text?
I mean... are numbers text? :thinking_face:"
jensimmons commentedon Jul 25, 2018
Also
fantasai commentedon Jul 25, 2018
Florian suggested
so maybe
astearns commentedon Jul 25, 2018
versalsorinitialswould be accurate terms. Whileversalsisn't in common use, it is relatively easy to spellfantasai commentedon Jul 25, 2018
So maybe (to borrow from @jensimmons suggestion, which seems to work for the relevant value space)
lettrine-spanorversal-span?wjmoner commentedon Jul 25, 2018
I agree with @astearns about using initials, and I like the idea of using span. I'll suggest
initial-decorationas a binary withinitial-spanas a numeric variable.initial-decorationcould also have a list of valuesinitial-decoration: 1 4 600to correspond to chars, vertical-size(is this initial span), font-weightmaybe?
AmeliaBR commentedon Jul 25, 2018
Unless the plan is to extend this property to apply beyond first child or first pseudo-element in a block, I think it is useful to preserve the
initial-(orinitials-) prefix for the properties.However, I agree that the suffix
-letter(or-letters, as it is currently spec'd) does not make sense for the primary property, which isn't defining a letter to use, it's defining a number of lines to span and to drop.I would argue against the following suggestions:
lettrine,versals: obscure terms. I'd have no idea what these words meant if they weren't part of this discussion. I'd probably have a hard time remembering how to spell either, and my browser dictionary tells me that the correct spellings are incorrect.-ornaments,-decoration: imply something added to the text, not just text sizing changes.dropcap: implies that the "dropping" part is essential. (And maybe isn't very easily translated to languages that don't have capitalization?)line-span: would be nice if the property actually applied to any element (like a floated image), but it doesn't communicate the "initial" restrictions in the spec. Andline-span-align,line-span-wrapare just confusing.I think
initial(s)-line-spanis clear, if long. Orinitials-span, with thesrequired to preventspanfrom being read as a noun. Alternatives:initials-scaleorinitials-expansion, but those don't cover the "drop" half of the property as effectively.The other properties would just be
initials-align,initials-wrap.(Sadly, there is no potential for an
initialsshorthand so long as the alignment properties are inherited and the sizing one is not. If there was an interest in changing the inheritance to create an overall shorthand, though, then the main property could be decomposed intoinitial-scalevsinitial-drop, where-drophasautoas a default.)kgcreative commentedon Jul 25, 2018
Found this conversation via Jen Simmon's tweet. Here to provide a bit of context on how we approached drop caps in old-school (pre-internet) typography, and hopefully to help guide this discussion a bit from that context.
Selector
Properties
Versals generally had two parameters:
Relevant to this discussion:
In this case, this seems to be a property that's being applied to the existing
::first-letterpseudo element, which makes the "number of characters" parameter moot.In an ideal world, this would be styled as
because this is being applied to the
::first-letterpseudo element (or, in the future, I can imagine::first-nth-letters(3)), then we can simply use:fantasai commentedon Jul 25, 2018
Hi @wjmoner and @kgcreative, there's a full spec for all the relevant properties and their syntax at https://drafts.csswg.org/css-inline-3/#initial-letter-styling ; we're just looking for a new property name. :)
fantasai commentedon Jul 25, 2018
@AmeliaBR WFM
Crissov commentedon Jul 25, 2018
Iʼd like to approach this with non-existing keywords for the most common cases in mind. These sound reasonable to me:
In particular,
line-span, which I liked initially, makes no sense this way.kgcreative commentedon Jul 25, 2018
to build off of @Crissov
initial-charsfeels more descriptive to me thaninitial-letters8 remaining items
jensimmons commentedon Nov 14, 2018
Looking at this fresh, I feel like we are struggling to make
initialwork in any sort of way, and it's just not working. CSS Properties are descriptive of the change that the property will make (likefont-size), and not of the motivation for making the change (not 'readable-type). Initial ends up sounding like an adjective, and gets easily confused withfirst-letter`. It doesn't come across as a noun.I like what
line-spandoes — it describes the context, affecting lines, and the result, setting a span across several lines. But as many have argued,spancould be easily confused with its other meanings in HTML & CSS.What if we try to find other words to do what
line-spanwould do. Synonyms for "span" include:interval
length
period
space
spell
stretch
term
amount
compass
extent
measure
reach
spread
time
line-spread?line-reach?character-spread????
Then you'd end up with
character-spread-aligncharacter-spread-wrapor
line-reach-alignline-reach-wrapor something down this road...
jensimmons commentedon Nov 14, 2018
Actually, I think
line-reachis confusing reading it back.character-reachandline-spreadare better first rough thoughts.Dan503 commentedon Nov 14, 2018
Don't go with
character-*. "character" suggests the inline (horizontal) direction whereas "line" suggests the block (vertical) direction.This property is all about the vertical/block direction so we should use
line-*. Whatever the name ends up being the first word of that name should be "line".Out of the possible second words you provided, I like these possibilities:
jonjohnjohnson commentedon Nov 15, 2018
As @AmeliaBR says...
@Dan503 I think resorting to the use of a generic
line-prefix will always leave authors wanting. Especially when we've already taught themline-heightas something that doesn't solely apply to these "initial letters".Dan503 commentedon Nov 15, 2018
Ah yes, that's a good point. Maybe not
line-*then. 🤔In that case we should think of what all the possible names for that first big letter could be.
These are names I can think of:
cap-*drop-*principle-*prominent-*lead-*hero-*first-*giant-*giga-*mega-*boss-*master-*booster-*pro-*chief-*css-meeting-bot commentedon Jan 23, 2019
The CSS Working Group just discussed
better name for initial-letters property.The full IRC log of that discussion
<dael> Topic: better name for initial-letters property<dael> github: https://github.com//issues/2950#issuecomment-438736819
<dael> jensimmons: As issue says we're debating a name. Kinda hit me is a way to approach is desc what this does. I wrote some stuff, but I disagree with myself.
<dael> jensimmons: Right now I'm thinking maybe line-span is a poss. I originally rejected because span is in the html, but there's em in html and em unit in CSS and that's never confused.
<dael> fantasai: Okay with that
<dael> jensimmons: Made me wonder if you can do more than make a letter big. Like if you had an image would it do anything?
<dael> fantasai: Yes, if you apply to an atomic element it will apply. There is text on how this works with inline blocks and images.
<dael> astearns: Def. intended to work in that case
<dael> fantasai: I think that was my favorite from the list
<dael> astearns: Other opinions?
<dael> dauwhe: Plausable to me
<AmeliaBR> But to clarify: it still only applies to the first element of a block? So that's the bit that isn't conveyed by the name.
<dael> bradk: line-span makes it sound like it would be any inline element and it would span the line. That was my concern
<dael> jensimmons: Agree we need to think about that
<dael> astearns: Table this for now and get to it at F2F. Let's try and get to this on the first day to make sure we give it needed time
fantasai commentedon Jun 3, 2020
RESOLVED: Stay with the name
initial-letter