BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.19k stars 757 forks source link

CSS changes within HTML Imports ignored #1044

Open chrisfay opened 8 years ago

chrisfay commented 8 years ago

Issue details

I'm using browsersync + grunt-contrib-watch using the instructions here https://www.browsersync.io/docs/grunt/. Will browsersync work with css that is included within an HTML import? I'm including css within an HTML import and browsersync ignores any changes within those css files, but works fine on css NOT included within an import. This is an architectural requirement for a unique project I'm working on, so simply rerouting the compiled css to a file outside the import isn't an option.

e.g.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">

<!-- // CSS compiled here refreshes properly--> <link rel="stylesheet" href="styles.css">

<!-- CSS compiled and linked via this import NOT injected into the page after sass compilation --> <link rel="import" href="import.html">
</head> <body>

</body> </html>

Steps to reproduce/test case

{cli command here}

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

NA

shakyShane commented 8 years ago

Do you mean your css is embedded inline in the import?

chrisfay commented 8 years ago

No, not inline. The html import links to a stylesheet.

shakyShane commented 8 years ago

ok, well either way if the element you want reloading is not on the same page as the Browsersync JS file, then I don't think this will be possible

chrisfay commented 8 years ago

Bummer :(

shakyShane commented 8 years ago

@chrisfay I'm just not sure if the current page has access to resources loaded within an import - I have no experience in this area. If anyone else does, please enlighten us :)

chrisfay commented 8 years ago

I just tried this with CodeKit and it worked as expected, where changes to css linked from inside an html import were properly live-reloaded in the main html page, so I know it's technically possible.

tj commented 7 years ago

Same with css imports apparently, forcing a reload would be fine no? vs injecting