Skip to content

[css-inline] initial-letter appliance and inheritance #2184

Closed
@Loirooriol

Description

@Loirooriol

initial-letter does not inherit and applies to

::first-letter pseudo-elements and inline-level first child of a block container

The problem is that the inline-level first child box of a block container is the root inline box, which cannot be targeted using selectors.

If the definition refers to the first child in the element tree then that's a problem with display: contents. And if you have <div><b><i>Text</i></b></div>, it's not clear why initial-letter applies to b but not to i.

In any case, since there is no inheritance, it's not clear what happens if you set initial-letter both to that first child and to the block container's ::first-letter, or to nested ::first-letters.

Instead, I think there are three reasonable possibilities:

  • initial-letter only applies to block containers that establish an inline formatting context, and affects the initial letter of the block container. But note that often the block container that establishes the IFC is an anonymous one, so initial-letter should inherit.
  • initial-letter only applies to innermost ::first-letter pseudo-elements, but it inherits, so you can set it on a block-level, inline-level or ::first-letter parent box.
  • initial-letter only applies to innermost ::first-letter pseudo-elements. And that's all because it doesn't inherit.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions