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

iron-icon hidden attribute does not work inside shadow root #97

Closed
1 of 8 tasks
danielx opened this issue Feb 28, 2017 · 2 comments
Closed
1 of 8 tasks

iron-icon hidden attribute does not work inside shadow root #97

danielx opened this issue Feb 28, 2017 · 2 comments

Comments

@danielx
Copy link

danielx commented Feb 28, 2017

Description

When using iron-icon inside a shadow root the global [hidden] { display: none; } CSS rule gets blocked and iron-icon stays visible.

Expected outcome

The hidden attribute should apply display: none;

Live Demo

https://jsbin.com/xidewewaki/2/edit?html,output

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Related to: PolymerElements/paper-button#122

@notwaldorf
Copy link
Contributor

You need to add the style for hidden inside the shadow root. hidden has the lowest specificity, and it gets overwritten (see PolymerElements/paper-item#58 for a very long discussion on the topic)

@danielx
Copy link
Author

danielx commented Feb 28, 2017

I'm sorry, it somehow slipped my mind to provide the entire reason and all information when i created this issue.

Currently in shady DOM iron-icon gets hidden because a rule for [hidden] { display: none !important; } gets leaked from iron-flex-layout.html#L51 and places above the .iron-icon-0 style that acts as :host.

https://jsbin.com/bunozaloqe/1/edit?html,output

This makes the current behavior different in the shady and shadow DOM modes since shadow DOM does not leak like shady DOM.

Though it begs the question if it's iron-icon's responsibility to have a :host([hidden]) { ... } or the element placing it within its shadow root that needs to apply iron-icon[hidden] { ... }.

@danielx danielx closed this as completed Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants