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
Does not work with <style> @import url("..."); </style> #10
Comments
This is an interesting problem & not one I've even looked into. It'll be low priority on the list of fixes for me, but i'll certainly look into this. Also if you manage to get it work - even better :) |
This is not currently on the roadmap, but you could trigger a full page refresh instead: |
Hey guys, I know the issue is closed but just for the record... I got it working by installing the Link CSS Drupal module. Here is the link if you want to check it out: https://drupal.org/project/link_css Cheers |
How did that help? I'm guessing it creates |
Yes, that is right. Drupal out of the box embeds CSS using |
You could leave that open though. Even if it's not a bug, definitely it's a missing feature not noted in README :< Livereload has support not only for reloading We could extend |
+1 for this! |
Or at least at it to the readme :-) |
Should this really be closed? It would be a great feature! |
works perfectly for me. |
@shakyShane I didn't see the OP say anything about only wanting CSS injection, my bad. I figured others could benefit from some kind of working solution for now. |
@SgtPooki - oh yeah, that's correct :) Well either way, we'll be adding this In a way that allows css injection :) |
Adding a note in the readme would have saved me hours of frustration. Although I should have just searched this issue queue to find this. Anyway, just a note in the readme as a starting point would really help new users (especially Drupal users) getting to grips with browser-sync. |
A temp fix: Place this in your template.php and it will generate link tags instead of @import's in your local environment.
|
I have been using a similar one as mentioned by @gijsroge. Only difference is disabling /**
* Implements hook_css_alter().
*
* Disables @import CSS tags for compatibility with BrowserSync.
*/
function HOOK_css_alter(&$css) {
// Aggregation must be disabled.
if (!variable_get('preprocess_css')) {
// Disable @import on each css file.
foreach ($css as &$item) {
// Compatibility with disabling stylesheets in theme.info (263967).
if (file_exists($item['data'])) {
$item['preprocess'] = FALSE;
}
}
}
} |
You probably could port the code for reloading File Seems an easy and safe thing to do. |
similar to @skh-'s temp fix , but for Drupal 8:
|
Here’s my use case: I have
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 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. |
Thanks @taivu. I wrapped mine in a custom module, but it works great! |
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!
The text was updated successfully, but these errors were encountered: