Skip to content

Commit

Permalink
feat: 1.样式主题模块化
Browse files Browse the repository at this point in the history
  • Loading branch information
JuckZ committed May 7, 2023
1 parent ab33a05 commit 327161c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"build": "pnpm run build-only",
"build:check": "run-p type-check build-only",
"d:theme": "sass --watch ./src/styles/theme/index.scss ../juckz.github.io/blogs/.obsidian/themes/\"Awesome Brain Manager\"/theme.css",
"t:theme": "sass --watch ./src/styles/theme/index.scss ./dest/out.css",

"preview": "vite preview",
"test": "vitest",
"test:unit": "vitest --environment jsdom --root src/",
Expand Down
1 change: 1 addition & 0 deletions src/main.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import 'styles/hover-editor';
@import 'styles/emoji-modal';
@import 'styles/update-modal';
// @import 'styles/theme';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 29 additions & 11 deletions src/styles/theme/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// https://github.com/whyt-byte/Blue-Topaz_Obsidian-css and https://github.com/kepano/obsidian-minimal

@mixin namespace($namespace) {
@at-root {

//.#{$namespace} & {
// @content;
//}
&.#{$namespace} {
@content;
}
}
}
@import 'obsidian-default-theme';
@import 'styles-setting';
@import 'fonts';
Expand All @@ -14,15 +26,21 @@
@import 'checkbox';

body {
--theme-color: var(--interactive-accent);
/*radius*/
--radius-xs: 3px;
--radius-s: 5px;
--radius-m: 7px;
--radius-l: 15px;
--font-size-preview-blockquote: 1em;
--callout-color: var(--interactive-accent-rgb);
// tag
--font-size-tag: 0.75em;
--font-family-special-tag: "Lucida Handwriting", "Segoe UI Emoji";
@include namespace('mod-windows') {
--theme-color: var(--interactive-accent);
/*radius*/
--radius-xs: 3px;
--radius-s: 5px;
--radius-m: 7px;
--radius-l: 15px;
--font-size-preview-blockquote: 1em;
--callout-color: var(--interactive-accent-rgb);
// tag
--font-size-tag: 0.75em;
--font-family-special-tag: "Lucida Handwriting", "Segoe UI Emoji";
}
}

// .mod-windows {
// @extend body;
// }

0 comments on commit 327161c

Please sign in to comment.