Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
romainmenke committed Jun 11, 2022
commit 54627a6a0553459055b2038c797626b8df200756
8 changes: 5 additions & 3 deletions plugins/css-prefers-color-scheme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ ECMA Script:
## CORS

⚠️ Applies to you if you load CSS from a different domain than the page.
In this case the CSS is treated as untrusted and will not be made available to the Javascript polyfill.

In this case the CSS is treated as untrusted and will not be made available to the JavaScript polyfill.
The polyfill will not work without applying the correct configuration for CORS.

Example :

Expand All @@ -252,8 +254,8 @@ Firefox :

To resolve CORS errors you need to take two steps :

- add HTTP header `Access-Control-Allow-Origin: <your-value>` to your CSS file.
- add `crossorigin="anonymous"` to the `<link rel="stylesheet">` tage for your CSS file.
- add an HTTP header `Access-Control-Allow-Origin: <your-value>` when serving your CSS file.
- add `crossorigin="anonymous"` to the `<link rel="stylesheet">` tag for your CSS file.

In a node server setting the HTTP header might look like this :

Expand Down
2 changes: 1 addition & 1 deletion plugins/css-prefers-color-scheme/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ the hexidecimal value of black. Likewise, `70` is chosen for light mode because
it is the keycode for `f`, the hexidecimal value of white.
These are suffixed with a random large number.

<link-list>
<linkList>
[Media Queries]: <specUrl>