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

helium.data.stylesheets is undefined #24

Open
welpher opened this issue Nov 21, 2014 · 11 comments
Open

helium.data.stylesheets is undefined #24

welpher opened this issue Nov 21, 2014 · 11 comments
Labels

Comments

@welpher
Copy link

welpher commented Nov 21, 2014

cause helium.data.stylesheets.sort(); is not a function error

@geuis
Copy link
Owner

geuis commented Nov 26, 2014

Browser?

@welpher
Copy link
Author

welpher commented Nov 26, 2014

chrome firefox all get this error

@welpher
Copy link
Author

welpher commented Nov 26, 2014

I copy a url, and click the button, redirect to the url I copied, when come back get this error

@geuis
Copy link
Owner

geuis commented Nov 26, 2014

Hmm let me take a look

@geuis
Copy link
Owner

geuis commented Apr 28, 2015

@ashepherd89 Strange, I wasn't able to replicate this before. Would it be possible to see a test case?

@xeraa
Copy link

xeraa commented Jul 18, 2015

Could the problem be that there are no CSS files?

I have a single page site and inline the CSS, so there are no references to CSS files. Getting the same error.

@geuis
Copy link
Owner

geuis commented Jul 19, 2015

@xeraa ahh that might be it. Btw helium doesn't read inline css (since it looks for selectors and style="" on an element isn't something you select for) or style blocks declared on the page.

@xeraa
Copy link

xeraa commented Jul 19, 2015

@geuis yeah — I didn't find a tool that supported inlined CSS and gave up. Plus my HTML+CSS are a little over 17K gzipped, so it's probably not worth the trouble anyway ;)

But nice and simple script in general :)

@geuis
Copy link
Owner

geuis commented Jul 20, 2015

@xeraa When you say "inline", do you mean this:

<div style="color: #fff; background: #000"></div>

Or this

<style>
  div {
    color: #fff;
    background: #000;
  }
</style>

@xeraa
Copy link

xeraa commented Jul 20, 2015

The second one; I'm not duplicating the styles, just avoiding a HTTP request (using https://github.com/kaiinui/middleman-inliner).

@develophelbetica
Copy link

I'm pretty sure I was getting the same error:
"Uncaught ReferenceError: style is not defined"

--->
I added the following line:
var style = document.createElement('style');
before line 72

  var style = document.createElement('style');

  helium.$('body')[0].appendChild(style);
  helium.$('body')[0].appendChild(div);

.,. and I'm now getting the URL list box

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