[csswg-drafts] [css-pseudo-4] new generated content pseudo :between/:separator

hfhchan has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo-4] new generated content pseudo :between/:separator ==
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 selector 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
}


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2960 using your GitHub account

Received on Saturday, 28 July 2018 05:09:07 UTC