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

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

From: nilssolanki via GitHub <sysbot+gh@w3.org>
Date: Tue, 03 Jan 2017 13:05:11 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-270110074-1483448710-sysbot+gh@w3.org>
@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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:07 UTC