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

[0.8] <link rel="import" type="css"> styles are shimmed out of order #1349

Closed
cdata opened this issue Mar 30, 2015 · 4 comments
Closed

[0.8] <link rel="import" type="css"> styles are shimmed out of order #1349

cdata opened this issue Mar 30, 2015 · 4 comments
Assignees
Labels

Comments

@cdata
Copy link
Contributor

cdata commented Mar 30, 2015

Considering the following contrived custom element:

<dom-module id="x-example">
<style>
  :host {
    color: red;
  }
</style>
<link rel="import" type="css" href="./external-styles.css">
<style>
  :host {
    color: red;
  }
</style>
<template> <!-- ... --> </template>
</dom-module>
<script> Polymer({ is: 'x-example' }); </script>
/* external-styles.css */
:host {
  color: black;
}

The following shimmed stylesheet is generated:

<style scope="x-example">
x-example {
  color: red;
}

x-example {
  color: red;
}

x-example {
  color: black;
}
</style>

This results in an unexpected condition where the external stylesheet will always take precedence over the inline stylesheets. The expected outcome - for many who have used stylesheets in more traditional workflows - is for the stylesheets to be applied in the order they appear in the document, regardless of whether they are inline or externally referenced.

@cdata cdata added the 0.8 label Mar 30, 2015
@sorvell sorvell self-assigned this Mar 30, 2015
@sorvell
Copy link
Contributor

sorvell commented Mar 30, 2015

Thanks for the clear description. Acknowledge the issue and will fix it.

@cdata
Copy link
Contributor Author

cdata commented Mar 30, 2015

Thanks for checking it out. I think I understand why the "expected" outcome is hard to get right (asynchronous loading / shimming of the external stylesheet?). In the mean time, I'm using specificity tweaks to achieve the desired result.

@cdata
Copy link
Contributor Author

cdata commented Apr 25, 2015

Bumping this issue, in case it has been fixed.

@sorvell
Copy link
Contributor

sorvell commented May 5, 2015

Fixed via dbfe8f8.

@sorvell sorvell closed this as completed May 5, 2015
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

2 participants