From 5a825f7b09c439f74773ed7b288d4867ac0e683e Mon Sep 17 00:00:00 2001
From: dannyk3941 <52807859+dannyk3941@users.noreply.github.com>
Date: Thu, 9 Mar 2023 14:57:42 -0500
Subject: [PATCH] Feat/implement dark mode (#13)
* feat: initial dark mode toggle js and prefers-color-scheme media query
* chore: remove css variables test from _core.scss
* fix: dark mode bootstrap in index.js
* chore: clean up import in index.js
* fix: use data attribute in _core.scss and refactor darkMode.js
* chore: add script to run 'styles' package storybook from root directory and update readme
---
README.md | 3 +-
package.json | 1 +
packages/styles/index.html | 8 +++++-
packages/styles/src/index.js | 5 ++++
packages/styles/src/sass/base/_core.scss | 14 ++++++----
packages/styles/src/utilities/darkMode.js | 34 +++++++++++++++++++++++
6 files changed, 58 insertions(+), 7 deletions(-)
create mode 100644 packages/styles/src/utilities/darkMode.js
diff --git a/README.md b/README.md
index cdede770..f371cf93 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,8 @@ The CBP Design System (1.0) exists to provide a unifying user experience and red
$ cd design-system
$ npm install
$ npm run styles-dev # run the styles dev server
-$ npm run styles-build # runs vite build
+$ npm run styles-build # runs vite build to build out css and js
+$ npm run styles-sb # runs storybook for the styles package
```
The CBP Design System repo is set up as a monorepo that uses the "workspaces" feature from `npm` for managing multiple packages from a singular top-level, root package. [[NPM Workspaces]](https://docs.npmjs.com/cli/v8/using-npm/workspaces)
diff --git a/package.json b/package.json
index 2525f7b8..2599eeaa 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
"build-tokens": "npm run sd -w packages/styles",
"styles-dev": "npm run dev -w packages/styles",
"styles-build": "npm run build -w packages/styles",
+ "styles-sb": "npm run storybook -w packages/styles",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
diff --git a/packages/styles/index.html b/packages/styles/index.html
index 5d4a8416..25373654 100644
--- a/packages/styles/index.html
+++ b/packages/styles/index.html
@@ -238,7 +238,13 @@