LeaVerou / prefixfree

Break free from CSS prefix hell!

Home Page:http://projects.verou.me/prefixfree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caution: StyleFix breaks BrowserSync stream reloading

lastant opened this issue · comments

StyleFix converts <link ... /> into <style ... /> , and this breaks BrowserSync automatic style refresh. As a result, BrowserSync stylesheet reloading doesn't work, one needs to fully reload the page.
This is probably a wont-fix, but still good to know for some people.

Yeah, I can’t think of a way around this. I guess it could be possible to retain compatibility if we kept the original link around as well but disabled it and had a mutation observer for changes to its href (if that’s how Browsersync does its refresh)?

I just looked a bit deeper, and seems BrowserSync does analyze <style> too, but for some reason ignores my converted styles.. Here is the code:
https://github.com/BrowserSync/browser-sync/blob/92bf7d84894e9171ed8e313909d473bbd6c7368d/packages/browser-sync-client/vendor/Reloader.ts#L392