Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

css module hangs when file doesn't exist #25

Open
jfgilliam opened this Issue · 2 comments

2 participants

@jfgilliam

I want to load a css module only if it exists. This is to allow end users to create an overrides.css if they want to override what I deliver. I think this is better than them modifying my css or modifying the markup to include theirs, because an update will wipe out their changes. Is there a way to conditionally load the file?

@kriszyp
Owner

Do you have a way of determining (through some configuration) if the css module should be loaded prior to attempting to load it? Or do you want to just always try to load and see if there is a 404? Do you need notification for when the CSS was loaded? If you just need to request a stylesheet, you can do so like this: https://github.com/kriszyp/xstyle/blob/master/core/load-css.js#L103
If you need to be notified, you can use that plugin module. You could also conditionally call the load method based on some configuration information, if you have that available to you.

@jfgilliam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.