Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use forest theme in diagram #752

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c18574c
feat: use forest theme in diagram
Yash-Singh1 Apr 17, 2022
59679ab
chore: simplify logic for theme -> diagram theme
Yash-Singh1 Apr 22, 2022
f246ce6
Fix action button
sidharthv96 Jun 2, 2022
aaec74c
Merge branch 'master' into develop
sidharthv96 Jun 2, 2022
52141a0
Update Browserslist
sidharthv96 Jun 2, 2022
f070239
chore(deps-dev): bump eslint-plugin-mocha from 10.0.4 to 10.0.5
dependabot[bot] Jun 3, 2022
19a6dbb
chore(deps-dev): bump postcss-load-config from 4.0.0 to 4.0.1
dependabot[bot] Jun 3, 2022
3e3965b
chore(deps-dev): bump cypress-localstorage-commands from 1.7.0 to 2.1.0
dependabot[bot] Jun 3, 2022
5f43eec
chore(deps-dev): bump husky from 7.0.4 to 8.0.1
dependabot[bot] Jun 3, 2022
3df829f
Merge pull request #824 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 8, 2022
42156e5
Merge pull request #823 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 8, 2022
6f9e277
Merge pull request #821 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 8, 2022
8186dfd
Merge pull request #820 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 8, 2022
7dbb937
Update Browserslist
sidharthv96 Jun 8, 2022
eb2f587
Upgrade cypress
sidharthv96 Jun 8, 2022
0956e6a
Merge branch 'develop' of https://github.com/mermaid-js/mermaid-live-…
sidharthv96 Jun 8, 2022
cc3823a
Update Browserslist
sidharthv96 Jun 8, 2022
ff1557b
Update deps
sidharthv96 Jun 8, 2022
a40dfee
Merge branch 'develop' of https://github.com/mermaid-js/mermaid-live-…
sidharthv96 Jun 8, 2022
cfdab5c
Update deps
sidharthv96 Jun 8, 2022
f7b2b57
remove cypresss config from tsconfig
sidharthv96 Jun 8, 2022
766082b
Update deps
sidharthv96 Jun 8, 2022
9c71732
chore(deps-dev): bump @sveltejs/adapter-static (#833)
dependabot[bot] Jun 8, 2022
0923b63
chore(deps-dev): bump lint-staged from 13.0.0 to 13.0.1
dependabot[bot] Jun 10, 2022
32caebb
chore(deps-dev): bump eslint-plugin-tailwindcss from 3.5.0 to 3.5.2
dependabot[bot] Jun 10, 2022
f0d1489
chore(deps): bump node from 18.2.0 to 18.3.0
dependabot[bot] Jun 10, 2022
4c84642
Merge pull request #837 from mermaid-js/dependabot/docker/develop/nod…
sidharthv96 Jun 10, 2022
408f362
Merge pull request #836 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 10, 2022
bc77259
Merge pull request #834 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 10, 2022
6fdef6b
Update Browserslist
sidharthv96 Jun 10, 2022
c712972
chore(deps-dev): bump tailwindcss from 3.0.24 to 3.1.1
dependabot[bot] Jun 10, 2022
829c3df
Merge pull request #835 from mermaid-js/dependabot/npm_and_yarn/devel…
sidharthv96 Jun 10, 2022
010a6d7
Merge branch 'develop' of github.com:mermaid-js/mermaid-live-editor i…
Yash-Singh1 Jun 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/util/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ export const updateConfig = (config: string, updateEditor: boolean): void => {
});
};

export const toggleDarkTheme = (dark: boolean): void => {
export const toggleDarkTheme = (dark: boolean, theme: string): void => {
Yash-Singh1 marked this conversation as resolved.
Show resolved Hide resolved
codeStore.update((state) => {
const config = JSON.parse(state.mermaid);
if (!config.theme || ['dark', 'default'].includes(config.theme)) {
config.theme = dark ? 'dark' : 'default';
if (!config.theme || ['dark', 'default', 'forest'].includes(config.theme)) {
config.theme = dark ? (theme === 'forest' ? 'forest' : 'dark') : 'default';
Yash-Singh1 marked this conversation as resolved.
Show resolved Hide resolved
}

return { ...state, mermaid: JSON.stringify(config, null, 2), updateEditor: true };
Expand Down
2 changes: 1 addition & 1 deletion src/routes/__layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
themeStore.subscribe(({ theme, isDark }) => {
if (theme) {
document.getElementsByTagName('html')[0].setAttribute('data-theme', theme);
toggleDarkTheme(isDark);
toggleDarkTheme(isDark, theme);
}
});
});
Expand Down