Re: [csswg-drafts] [css-display] Add a third display-box keyword, similar to discard in box-suppress

@fantasai `display: none;` applies to children as well. The idea of 
`display: discard;` would be to only apply to the current element 
(same as `display: none;`), but explicitly not to children.

It would developers to pretend that a parent node doesn't exist, while
 the child node is displayed normally.

**Example:**

```
<ul class="list">
  <div class="random-insert">
    <li class="list-item"></li>
  </div>
  <div class="random-insert">
    <li class="list-item"></li>
  </div>
</ul>
```

```
.random-insert {
  display: discard;
}

.list-item:first-child {
  border-top: 1px solid red;
}
```

would be equivalent to:

```
<ul class="list">
  <li class="list-item"></li>
  <li class="list-item"></li>
</ul>
```

```
.list-item:first-child {
  border-top: 1px solid red;
}
```

Meaning, only the first `list-item` in the whole `list` would have a 
red top border.

Maybe `discard` is a misnomer in this case though…

-- 
GitHub Notification of comment by nilssolanki
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/456#issuecomment-270110074 
using your GitHub account

Received on Tuesday, 3 January 2017 13:05:22 UTC