LeaVerou / prefixfree

Break free from CSS prefix hell!
http://projects.verou.me/prefixfree/
MIT License
3.83k stars 712 forks source link

Caution: StyleFix breaks BrowserSync stream reloading #6152

Open lastant opened 4 years ago

lastant commented 4 years ago

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.

LeaVerou commented 4 years ago

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)?

lastant commented 4 years ago

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