Skip to content

Reset breaks the hidden-attribute on semantic elements #12

Closed
@mindplay-dk

Description

@mindplay-dk

The CSS reset appears to break the hidden attribute for numerous semantic elements, such as <section>.

For example, <section hidden> leads to a visible element after applying the reset, because the display: block property of that rule apparently trumps the effect of the hidden attribute in terms of specificity.

If it has to reset the display property of semantic block elements - and I'm not convinced that it needs to, because the semantic block elements should have display: block by default - but assuming it has to, it probably needs to include a more specific rule to restore the expected behavior of the hidden attribute, e.g. for example:

section[hidden] {
  display: none;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions