Skip to content

Commit

Permalink
feat(): Improved dark mode.
Browse files Browse the repository at this point in the history
* Simplify dark mode code.

* Cleanup.

* Update readme.

* Update synctheme fn.

* Update semantic release.

* Update default config.

* fix(): Trigger release

* fix(): Remove config files.

* Add prelease workflow.

* Update workflows.

* Add alpha prerelease.

* fix(): Expose isDark.

* fix(): Rename hook.

* Remove dom syncing by default.

* fix(): Trigger release

* Fix ssr.

* fix(): Trigger release.
  • Loading branch information
aidanCQ authored Sep 12, 2024
1 parent ec13ce8 commit daa55fe
Show file tree
Hide file tree
Showing 13 changed files with 1,418 additions and 1,423 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pre Release library
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!main' # excludes main

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
23 changes: 11 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,27 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install NPM dependencies
run: npm ci

- name: Build library and storybook
run: npm run build && npm run build-storybook
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build && npm run build-storybook

- name: Setup pages.
uses: actions/configure-pages@v2
- name: Upload artifact.
uses: actions/upload-pages-artifact@v1
with:
path: ./storybook-static/

- name: Publish storybook build to github pages
id: deployment
uses: actions/deploy-pages@v1

- name: Publish library to github packages and npm
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
10 changes: 0 additions & 10 deletions .releaserc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm run build # Build component library with rollup.
```

### Design Tokens
CSS variables are declared in `src/tokens.css`. Dark mode is toggled by the presence of the class `.theme-mode-dark` on the root document element (`<html />`).
CSS variables are declared in `src/tokens.css`. Dark mode is enabled by the presence of the attribute `data-theme` higher up in the tree.



Expand Down
Loading

0 comments on commit daa55fe

Please sign in to comment.