browser-sync: Does not work with
This is a great tool. However, it would be even better if it supported @import’s of stylesheets.
I realize that including stylesheets this way is not optimal, but it does get around IE’s limitation of 31 stylesheets, and is useful when in development - particularly with CMS’s that include a lot of stylesheets.
When I downloaded this tool to try it out I was working on a Drupal project, which happens to do this until you turn on CSS aggregation. But at that point it also changes the name of the CSS files and caches them.
I took a look at modifying browser-sync-client.js but it seems like it’s really only setup for altering <link> elements and ran short on time.
Thanks!
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 20 (5 by maintainers)
Commits related to this issue
- feat: support CSS imports - fixes #10 — committed to AsherBond/browser-sync by shakyShane 7 years ago
I have been using a similar one as mentioned by @gijsroge. Only difference is disabling
@importbased on the CSS aggregation setting (rather than theenvironmentvariable which isn’t part of core).similar to @skh-'s temp fix , but for Drupal 8:
Here’s my use case: I have
screen.csswith a number of imports:There are more nested imports in some files. And I don’t process my styles with anything to complie a single file, I just don’t need to. What I need is BS to watch files and push changes to browser. But only changes in
screen.csspropagate to browser. Changes in imported files detected too, but BS don’t push them.That’s how I start watcher:
Is it even possible to properly push changes from imported files? Is there a workaround for that, apart from reloading the whole page? Thank you.
A temp fix:
Place this in your template.php and it will generate link tags instead of @import’s in your local environment.
browser-sync start --server "." --files "**/*.*" --no-inject-changesworks perfectly for me.