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

External styles fails to load #420

Closed
tomalec opened this issue Feb 13, 2014 · 2 comments
Closed

External styles fails to load #420

tomalec opened this issue Feb 13, 2014 · 2 comments

Comments

@tomalec
Copy link
Contributor

tomalec commented Feb 13, 2014

I have noticed a problem with importing external CSS styles.

According to http://www.polymer-project.org/faq.html#externalsheets, following code should work (within same domain).

GET /cssImport/elements/cssImport-foo.html:

<polymer-element name="cssImport-bar">
    <template>
        <link rel="stylesheet" href="cssImport-foo.css">

and it worked at least a week ago.
Here is an example http://tomalec.github.io/sortable-flexbox-list/tests/cssImport/

Unfortunately now (with Polymer 1.4 and Canary 34.0.1838.2) it fails with an error:

GET http://.../cssImport/elements/ 404 (Not Found) 

With current Polymer#master #93e1f4bd07 it also fails, as <link> is replaced with <style>@import but with wrong path:

<style>@import 'http://.../cssImport/elements/cssImport-bar.html';</style>

Wich results this time with:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://.../cssImport/elements/cssImport-bar.html".

Luckily there is workaround - write correct @import manually:

<style>@import 'http://.../cssImport/elements/cssImport-bar.css';</style>

However, behavior described above looks suspicious.

@ebidel
Copy link
Contributor

ebidel commented Feb 13, 2014

FYI, I've removed the bit about external stylesheets from the docs since
we're using @import now.

On Thu, Feb 13, 2014 at 8:19 AM, Tomek Wytrębowicz <notifications@github.com

wrote:

I have noticed a problem with importing external CSS styles.

According to http://www.polymer-project.org/faq.html#externalsheets,
following code should work (within same domain).

GET /cssImport/elements/cssImport-foo.html:

and it worked at least a week ago.
Here is an example
http://tomalec.github.io/sortable-flexbox-list/issues/cssImport/

Unfortunately now (with Polymer 1.4 and Canary 34.0.1838.2) it fails
with an error:

GET http://.../cssImport/elements/ 404 (Not Found)

With current Polymer#master #93e1f4bd07 it also fails, as is
replaced with <style>@import but with wrong path:

<style>@import 'http://.../cssImport/elements/cssImport-bar.html';</style>

Wich results this time with:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://.../cssImport/elements/cssImport-bar.html".


Reply to this email directly or view it on GitHubhttps://github.com//issues/420
.

@tomalec
Copy link
Contributor Author

tomalec commented Feb 17, 2014

Thanks, It works fine with Polymer 0.2.0.

@tomalec tomalec closed this as completed Feb 17, 2014
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

No branches or pull requests

2 participants