-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[1.x] Adds support for shady-unscoped
attribute to style elements.
#4891
Conversation
These features have been removed from the only native implementation of Shadow DOM v0 (Chrome).
Since `/deep/` has been removed from Shady DOM v0, users must share styles between elements via style modules (e.g. `<style include="shared-style">`). Under ShadyDOM, these styles are scoped and duplicated between elements. If these styles are intended to replace global styling done with `html /deep/ ...` this is inefficient since the styles are needlessly copied to each element style. Therefore, this adds support for a `shady-unscoped` attribute. If this attribute is placed on a style and native Shadow DOM is not in use, then the style is copied once to the document and are left unscoped. Please note, css custom properties are not supported in `shady-unscoped` styles.
@@ -0,0 +1,26 @@ | |||
<dom-module id="global-shared1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license header
@@ -0,0 +1,121 @@ | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license header
@@ -0,0 +1,3 @@ | |||
.import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license header
Add support for styles with a
shady-unscoped
attributeSince
/deep/
has been removed from Shady DOM v0, users must share styles between elements via style modules (e.g.<style include="shared-style">
).Under ShadyDOM, these styles are scoped and duplicated between elements. If these styles are intended to replace global styling done with
html /deep/ ...
this is inefficient since the styles are needlessly copied to each element style.Therefore, this adds support for a
shady-unscoped
attribute. If this attribute is placed on a style and native Shadow DOM is not in use, then the style is copied once to the document and are left unscoped.Please note, css custom properties are not supported in
shady-unscoped
styles.Fixes #4856