Skip to content

Commit

Permalink
Use jsDeliver for example
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonaaron committed Nov 24, 2023
1 parent aea43d8 commit 285642d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Add this to the `<head>`:

```html
<!-- tiny render blocking script to avoid flash of content -->
<script src="path/to/dist/DarkPref.blocking.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@brandonaaron/dark-pref@1.0.0/dist/DarkPref.blocking.js"></script>
<!-- rest of the exports could be bundled with your favorite bundler too -->
<script src="path/to/dist/DarkPrefToggleElement.js" type="module"></script>
<script src="https://cdn.jsdelivr.net/npm/@brandonaaron/dark-pref@1.0.0/dist/DarkPrefToggleElement.js" type="module"></script>
<style>
:root { /* optional css variables */
--dark-pref-when-light-color: #999; /* defaults to #000 */
Expand Down
14 changes: 14 additions & 0 deletions examples/basic-cdn.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@brandonaaron/dark-pref@1.0.0/dist/DarkPref.blocking.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@brandonaaron/dark-pref@1.0.0/dist/DarkPrefToggleElement.js" type="module"></script>
<style>
html { background-color: #fff; color: #000; }
html.dark { background-color: #000; color: #fff; }
</style>
</head>
<body>
<dark-pref-toggle></dark-pref-toggle>
</body>
</html>

0 comments on commit 285642d

Please sign in to comment.