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

templating resources break scoped styling for ShadowDOM #304

Closed
cyantree opened this Issue Aug 26, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@cyantree
Contributor

cyantree commented Aug 26, 2017

I'm submitting a bug report

  • Library Version:
    1.4.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.11.0

  • NPM Version:
    5.3.0
  • JSPM OR Webpack AND Version
    webpack 3.5.5
  • Browser:
    Chrome 60

  • Language:
    TypeScript 2.4.2

Current behavior:
When using ShadowDOM (via element decorator @useShadowDOM) and a scoped style within the elements template (via <require ... as="scoped">), the scoped style gets imported as global one as well when using templating resources as attributes in the same template.

Please see the following example:

Expected/desired behavior:

  • What is the expected behavior?
    Scoped styling must stay within the component and not be injected into the document head.

  • What is the motivation / use case for changing the behavior?

Possible solution:

  • CSSViewEngineHooks may in some cases always inject the style globally even if it isn't declared as global.
  • I'll create a pull request for that shortly. Hopefully that doesn't break anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment