W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

[csswg-drafts] [css3-selectors][css-pseudo-4] Add Pseudo Element ::around or ::wrap simmilar to ::before / ::after

From: inoas via GitHub <sysbot+gh@w3.org>
Date: Tue, 10 Jan 2017 15:18:04 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-199848480-1484061482-sysbot+gh@w3.org>
inoas has just created a new issue for 

== [css3-selectors][css-pseudo-4] Add Pseudo Element ::around or 
::wrap simmilar to ::before / ::after ==
In essence `display: flex`, `display: grid` and `display: table` + 
float hacks already give a lot of flexibility on rendering layout. 
However more often than not authors have to add `div` / `span` just 
for rendering/presentation purposes.

### Proposal
Add `::around` or `::wrap` pseudo-elements.

### Example Use Case
/* horizontally centered article having a max-width */
article {
  max-width: 500px;
  margin: 0 auto;
article.with-background::around, /* fully stretched background if 
class given */
article.nth(2)::around { /* fully stretched background on every 2nd 
element */
  display: block;
  width: 100%;
  background: orange;

Usually these presentional-only boxes would require extra divs in the 

<div class="max-width-container">


<article class="with-background">

#### Codepen Examples
Div Wrapper: http://codepen.io/anon/pen/jyWqqE
Pseudo Wrapper: http://codepen.io/anon/pen/JEGKKw

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/877 using your GitHub 
Received on Tuesday, 10 January 2017 15:18:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:27 UTC