Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cater for "hidden" attribute #71

Open
pimdewit opened this issue Jan 9, 2020 · 1 comment
Open

Cater for "hidden" attribute #71

pimdewit opened this issue Jan 9, 2020 · 1 comment

Comments

@pimdewit
Copy link
Contributor

pimdewit commented Jan 9, 2020

Setting display: block; on elements will overwrite the hidden attribute's functionality. Currently cssremedy is putting display block on a variety of elements.

I guess the preferred way is to have img:not([hidden]) { display: block; } etc.
Or perhaps specify [hidden] { display: none } to save on filesize?

@mirisuzanne
Copy link
Collaborator

Merged the initial fix, which addresses a problem caused by other remedies. But then I started digging into the potential for adding !important here, as a remedy in it's own right.

The html spec is clear that users can override the [hidden] attribute, and I think browsers are implementing it as a zero-specificity author-origin presentational hint similar to width/height. That's why it's so easy to override right now. But the spec also says that hidden should only be used when hiding completely, which implies users should not override it even though they can.

All that to say: I think !important might make sense on this as a remedy for the current browser handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants