container-query-polyfill
container-query-polyfill copied to clipboard
Local CSS Imports
Hey there, I'm dealing with a legacy system so I've opted to use the IIFE version. However, It's now throwing the following error on my stylesheets containing local imports.
Uncaught (in promise) Error: (styles.css): Advanced beyond the end
Removing the imports resolved the issue and allowed the script to do its job once more. I can look into alternative methods to my CSS imports, but hopefully I can find a way to resolve this without restructuring everything.
Are you talking about @import? Because yes, I totally did not add support for that. Can you give me a small code sample that breaks?
I think I have a hint. Blocks when adding a ccs file with @import OR with :root {--whatever}. Then I have another problem: doesn't work with CSP, beacaus of blob:URL
So I tried to recreate this outside of my other environment and all seems fine with the import. I need to look more into this come Monday.
https://codepen.io/ThomasDaugherty/project/editor/AMQRLd
I managed to find a moment. So I've updated that pen above to include a quick toggle to help showcase the issue.
Success: good.css, Includes styling for the card module, Includes :root, Zero imports. Failure: bad.css, Only imports good.css
I'm seeing the same problem with this when trying to include the IIFE. The only container query I've got on the page is included just before this script. You can see the error here: https://tim.ac-leo.com
This issue should be resolved by the latest version of the polyfill (currently in alpha). Please give that a try and feel free to open a new issue if you run into further troubles.
Thank you!