Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add [hidden] selector to Base to counteract all display declarations
Anytime a Pure style rule uses the `display` declaration with a value
other than `none`, using the `hidden` HTML attribute on that element
won't have the desired affect of hiding that element. To counteract
this, A new rule has been added to Base to force
`display: none !important;` on elements that use the `hidden` HTML
attribute.

The following button will be hidden from view with these changes:

    <button class="pure-button" hidden>No showy</button>

Fixes #177
  • Loading branch information
ericf committed Dec 7, 2013
commit ba39a319f38346fbbe401316be9202d7face6946
14 changes: 12 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ NEXT

### Base

* The `body` selector in the `base-context` module is now replaced with `.pure`,
like the `html` selector.
* Elements that have Pure classnames which set a `display` declaration _and_ use
the `hidden` HTML attribute will now properly be hidden. With these changes,
the following button will be hidden from view:

```html
<button class="pure-button" hidden>No showy</button>
```

A new rule for the `[hidden]` selector has been added with the declaration:
`display: none !important;`. This is a time where it's appropriate for a
project like Pure to use `!important`. ([#177][])

### Buttons

Expand Down Expand Up @@ -47,6 +56,7 @@ NEXT
[#144]: https://github.com/yui/pure/issues/144
[#164]: https://github.com/yui/pure/issues/164
[#174]: https://github.com/yui/pure/issues/174
[#177]: https://github.com/yui/pure/issues/177
[#191]: https://github.com/yui/pure/issues/191
[#200]: https://github.com/yui/pure/issues/200
[#221]: https://github.com/yui/pure/issues/221
Expand Down
8 changes: 8 additions & 0 deletions src/base/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
/**
* Extra rules that Pure adds on top of Normalize.css
*/

/**
* Always hide an element when it has the `hidden` HTML attribute.
*/

[hidden] {
display: none !important;
}