Skip to content

[css-pseudo-4] new generated content pseudo :between/:separator #2960

@hfhchan

Description

@hfhchan

When building toolbars, navbars and lists, often there needs to be separators. They are currently implemented by using :before and/or :after but this is a hacky:

(1) the separator is not semantically a part of the toolbar item or list item itself;
(2) the separator messes with hit-testing i.e. hovering the separator would either select the previous or next item which may not be preferred
(3) relying on more specific selectors to turn off the selector at the start and/or end of the list.

The effect could be more elegantly accomplished by providing a way to insert generated content between a given node's children.

Example:

ul.recycler::between {
display: block;
content: "";
border-bottom: 1px solid #ccc;
margin: 0 40px
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions