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

Lazy-loaded <style is="custom-style"> should trigger Polymer.updateStyles #3705

Closed
1 task done
kevinpschaaf opened this issue Jun 10, 2016 · 2 comments
Closed
1 task done
Labels

Comments

@kevinpschaaf
Copy link
Member

Description

Lazy-loaded <style is="custom-style"> should trigger global updateStyles. If you currently async load an import that contains a top-level custom-style (or more likely, an element that depends on a custom-style, such as paper-card), although the custom-style gets registered and the global Polymer.StyleDefaults properties get updated, they do not cascade down the tree.

Live Demo

Works (paper-card loaded sync): http://jsbin.com/raboji/edit?html,output
Fails (paper-card loaded on demand): http://jsbin.com/ruhuqo/edit?html,output

Steps to Reproduce

See failing example above. Note, it's important to have a host element that consumes custom properties between the lazy-loaded element consuming lazy-loaded styles and the root, otherwise the custom property styles are chained lazily back up to the root and it will work.

Expected Results

Styles applied by global <style is="custom-style"> should apply after being lazy-loaded.

Actual Results

Styles applied by global <style is="custom-style"> do not apply after being lazy-loaded.

Browsers Affected

  • Chrome

Versions

  • Polymer: v1.5.0
  • webcomponents: n/a
@milesje
Copy link

milesje commented Jun 13, 2016

This also affects the use iron-flex and iron-flex-alignment within an element that is being lazy-loaded.

<dom-module id="my-element">
    <template>
        <style include="iron-flex iron-flex-alignment">
            :host {
                display: block;
            }

@FredKSchott
Copy link
Contributor

For exposure, we've recently seen bugs reported on this underlying behavior in the polymer-cli & app-drawer-template repos

sorvell pushed a commit that referenced this issue Jun 23, 2016
Ensure custom styles updated after adding custom-style async. Fixes #3705.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants