-
-
Notifications
You must be signed in to change notification settings - Fork 143
Insert style-loader loaded CSS at top of <head/> #382
Conversation
Could we add an integration test with percy here? Something that mimics the user code by supplying some CSS in the |
@chriddyp Good point - I've added one. I tried to do some assertions on the CSS being set, but couldn't get it to work. The suggested Edit: Ok, seems the Percy snapshot isn't picking up the CSS changes either - even though running the test locally you can see them be set. |
With percy, you need to explicitly set the CSS folder and CSS URL. From #312:
See the percy Setup docs here: https://docs.percy.io/docs/python-selenium You can also reach out to the percy team if you can't get those settings to work. |
@chriddyp Is it working in the main |
Not sure off the top of my head. You might be able to check out the Percy snapshots in that repo and see they look like they have custom css applied. |
Also, looking at |
Just tested and it doesn't load the assets in the dash tests percy snapshots. |
Ah too bad. Thanks for taking a look! |
But I got them to load with this config:
|
@T4rk1n Anything else you've changed? I still can't get them to load. |
No only thing I see different is the root_dir is relative |
Here you can see the whole changes: |
@T4rk1n That was it - removing the root_static_dir suggested by the Percy docs and having the root_dir relative fixed it. Thanks for your help! |
Great, look like it worked 💃 You can review plotly/dash#461 while you are at it ? |
… into hotfix-style-loader
This fixes and closes #380 by inserting the default CSS loaded by
style-loader
at the top of<head/>
, so that user loaded CSS will be below it, allowing users to overwrite the default CSS.