Release WeiYa Theme 1.0.0

This commit is contained in:
吴伟亚 2026-07-16 02:51:22 +08:00
commit dfdfca4c2c
7 changed files with 446 additions and 0 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 WeiYa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

89
README.md Normal file
View file

@ -0,0 +1,89 @@
# WeiYa Theme
一款安静、克制、适合长时间阅读的 Obsidian 主题,视觉取向接近 macOS 原生界面。
A quiet, restrained Obsidian theme designed for long reading sessions, with a macOS-inspired visual direction.
![WeiYa Theme dark preview](screenshots/dark.png)
![WeiYa Theme light preview](screenshots/light.png)
## 中文
### 特点
- 同时支持浅色与深色模式。
- 优先覆盖 Obsidian 官方语义 CSS 变量。
- 正文宽度、字号与行高针对长时间阅读调整。
- 覆盖标题、链接、列表、Callout、代码块、表格和侧边栏。
- 桌面端侧边栏使用低透明材质;移动端自动降级为实色。
- 不加载远程字体、图片、脚本或其他外部资源。
### 从社区主题安装
1. 打开 Obsidian 的“设置”。
2. 进入“外观”→“主题”→“管理”。
3. 搜索 `WeiYa Theme`,点击“安装并使用”。
### 手动安装
1. 下载 Release 中的 `manifest.json``theme.css`
2. 在知识库中创建 `.obsidian/themes/WeiYa Theme/`
3. 将两个文件放入该目录。
4. 重启或重新加载 Obsidian然后在“设置”→“外观”中选择 `WeiYa Theme`
### 兼容性
- 最低 Obsidian 版本:`1.9.0`。
- 已在 macOS 上的 Obsidian `1.12.7` 验证浅色、深色与窄窗口表现。
- 主题包含移动端安全降级规则iPhone 与 iPad 实机表现尚未完成正式验证。
### 设计原则
WeiYa Theme 保持低选择器复杂度以官方变量为主只为阅读间距、Callout、代码块、表格和侧边栏补充必要样式。主题不隶属于 Apple 或 Obsidian 官方。
### 反馈
如遇到可复现的问题,请在本仓库的 Issues 页面提交 Obsidian 版本、操作系统、复现步骤和截图。
## English
### Features
- Light and dark appearances.
- Official Obsidian semantic CSS variables first.
- Reading-focused content width, typography, and line height.
- Styling for headings, links, lists, callouts, code, tables, and sidebars.
- Subtle translucent sidebars on desktop with a solid mobile fallback.
- No remote fonts, images, scripts, or external resources.
### Install from Community Themes
1. Open Obsidian **Settings**.
2. Go to **Appearance****Themes****Manage**.
3. Search for `WeiYa Theme`, then select **Install and use**.
### Manual installation
1. Download `manifest.json` and `theme.css` from the latest Release.
2. Create `.obsidian/themes/WeiYa Theme/` inside your vault.
3. Place both files in that folder.
4. Reload Obsidian and select `WeiYa Theme` under **Settings****Appearance**.
### Compatibility
- Minimum Obsidian version: `1.9.0`.
- Light, dark, and narrow-window layouts verified with Obsidian `1.12.7` on macOS.
- Mobile-safe fallback rules are included; formal iPhone and iPad device testing is still pending.
### Design principles
WeiYa Theme keeps selector complexity low, prioritizes official variables, and adds only focused styles for reading rhythm, callouts, code, tables, and sidebars. This project is not affiliated with Apple or Obsidian.
### Feedback
For reproducible issues, please use this repository's Issues page and include your Obsidian version, operating system, reproduction steps, and screenshots.
## License
[MIT](LICENSE) © 2026 WeiYa

6
manifest.json Normal file
View file

@ -0,0 +1,6 @@
{
"name": "WeiYa Theme",
"version": "1.0.0",
"minAppVersion": "1.9.0",
"author": "WeiYa"
}

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
screenshots/dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
screenshots/light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

330
theme.css Normal file
View file

@ -0,0 +1,330 @@
/*
* WeiYa Theme
* A quiet, restrained Obsidian theme designed for long reading sessions.
*/
/* Shared foundation */
body {
--font-interface-theme: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--font-text-theme: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--font-monospace-theme: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, monospace;
--font-text-size: 16px;
--line-height-normal: 1.72;
--file-line-width: 760px;
--p-spacing: 1em;
--h1-size: 1.8em;
--h2-size: 1.45em;
--h3-size: 1.2em;
--h4-size: 1.05em;
--h5-size: 0.95em;
--h6-size: 0.85em;
--h1-weight: 600;
--h2-weight: 600;
--h3-weight: 600;
--h4-weight: 600;
--h5-weight: 600;
--h6-weight: 600;
--radius-s: 6px;
--radius-m: 8px;
--radius-l: 10px;
--radius-xl: 12px;
--input-radius: 8px;
--tab-radius-active: 8px;
--modal-radius: 12px;
--menu-radius: 10px;
--callout-radius: 10px;
--link-decoration: none;
--link-decoration-hover: underline;
--link-external-decoration: none;
--link-external-decoration-hover: underline;
--list-marker-color: var(--text-muted);
--list-marker-color-hover: var(--text-accent);
--list-marker-color-collapsed: var(--text-accent);
--blockquote-border-thickness: 2px;
--table-border-width: 1px;
--table-header-weight: 600;
--table-row-alt-background: transparent;
--callout-border-width: 1px;
--callout-padding: 12px 14px;
}
/* Light appearance */
.theme-light {
--background-primary: #f7f7f5;
--background-primary-alt: #f2f2f0;
--background-secondary: #efefed;
--background-secondary-alt: #e8e8e5;
--background-modifier-border: #d9d9d5;
--background-modifier-border-hover: #c9c9c4;
--background-modifier-border-focus: #a9bbcd;
--background-modifier-form-field: #ffffff;
--background-modifier-form-field-highlighted: #f3f5f7;
--background-modifier-box-shadow: rgba(36, 36, 38, 0.12);
--background-modifier-hover: rgba(36, 36, 38, 0.055);
--background-modifier-active-hover: rgba(47, 109, 174, 0.11);
--background-modifier-success: rgba(79, 128, 99, 0.14);
--background-modifier-error: rgba(176, 70, 70, 0.12);
--background-translucent: rgba(247, 247, 245, 0.82);
--text-normal: #242426;
--text-muted: #6e6e73;
--text-faint: #99999e;
--text-on-accent: #ffffff;
--text-accent: #2f6dae;
--text-accent-hover: #25598f;
--text-error: #a94444;
--text-success: #47775a;
--interactive-normal: #f7f7f5;
--interactive-hover: #ececea;
--interactive-accent: #2f6dae;
--interactive-accent-hover: #285e96;
--interactive-success: #4f8063;
--link-color: #2f6dae;
--link-color-hover: #25598f;
--link-unresolved-color: #5e7790;
--link-unresolved-opacity: 0.72;
--tag-color: #2f5f91;
--tag-background: rgba(47, 109, 174, 0.1);
--tag-background-hover: rgba(47, 109, 174, 0.16);
--code-background: #efefed;
--code-normal: #303034;
--blockquote-background-color: rgba(47, 109, 174, 0.045);
--blockquote-border-color: #aebccb;
--h1-color: #242426;
--h2-color: #242426;
--h3-color: #303034;
--h4-color: #3b3b3f;
--h5-color: #525257;
--h6-color: #6e6e73;
--weiya-surface-raised: #ffffff;
--weiya-sidebar-background: rgba(239, 239, 237, 0.88);
--weiya-divider: #d9d9d5;
}
/* Dark appearance */
.theme-dark {
--background-primary: #1c1c1e;
--background-primary-alt: #202022;
--background-secondary: #242426;
--background-secondary-alt: #2c2c2e;
--background-modifier-border: #3a3a3c;
--background-modifier-border-hover: #4a4a4d;
--background-modifier-border-focus: #58738e;
--background-modifier-form-field: #2c2c2e;
--background-modifier-form-field-highlighted: #323236;
--background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
--background-modifier-hover: rgba(255, 255, 255, 0.055);
--background-modifier-active-hover: rgba(110, 168, 224, 0.14);
--background-modifier-success: rgba(108, 167, 128, 0.16);
--background-modifier-error: rgba(224, 112, 112, 0.14);
--background-translucent: rgba(28, 28, 30, 0.84);
--text-normal: #ececef;
--text-muted: #a1a1a6;
--text-faint: #737378;
--text-on-accent: #101113;
--text-accent: #6ea8e0;
--text-accent-hover: #8bbced;
--text-error: #e07a7a;
--text-success: #82bd95;
--interactive-normal: #2c2c2e;
--interactive-hover: #343438;
--interactive-accent: #6ea8e0;
--interactive-accent-hover: #82b6e8;
--interactive-success: #6ca780;
--link-color: #6ea8e0;
--link-color-hover: #8bbced;
--link-unresolved-color: #8297aa;
--link-unresolved-opacity: 0.76;
--tag-color: #a9d0f3;
--tag-background: rgba(110, 168, 224, 0.13);
--tag-background-hover: rgba(110, 168, 224, 0.2);
--code-background: #242426;
--code-normal: #e1e1e5;
--blockquote-background-color: rgba(110, 168, 224, 0.055);
--blockquote-border-color: #526c84;
--h1-color: #f3f3f5;
--h2-color: #ececef;
--h3-color: #e2e2e5;
--h4-color: #d2d2d6;
--h5-color: #bdbdc2;
--h6-color: #a1a1a6;
--weiya-surface-raised: #2c2c2e;
--weiya-sidebar-background: rgba(36, 36, 38, 0.88);
--weiya-divider: #3a3a3c;
}
/* Reading and editing */
.markdown-rendered,
.markdown-source-view.mod-cm6 {
font-variant-ligatures: common-ligatures;
text-rendering: optimizeLegibility;
}
.markdown-rendered p {
margin-block: 0 var(--p-spacing);
}
.markdown-rendered :is(h1, h2, h3, h4, h5, h6) {
letter-spacing: -0.01em;
}
.markdown-rendered h1 {
letter-spacing: -0.02em;
}
.markdown-rendered a {
text-decoration-thickness: 0.06em;
text-underline-offset: 0.16em;
}
.markdown-rendered :is(ul, ol) {
padding-inline-start: 1.6em;
}
.markdown-rendered li {
margin-block: 0.22em;
}
/* Callouts */
.callout {
background-color: rgba(var(--callout-color), 0.08);
border: 1px solid rgba(var(--callout-color), 0.22);
border-radius: var(--callout-radius);
box-shadow: none;
}
.callout-title {
font-weight: 600;
}
/* Inline and fenced code */
.markdown-rendered code,
.markdown-source-view.mod-cm6 span.cm-inline-code {
border: 1px solid var(--background-modifier-border);
border-radius: 5px;
padding: 0.1em 0.34em;
}
.markdown-rendered pre {
background: var(--code-background);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
box-shadow: none;
padding: 14px 16px;
}
.markdown-rendered pre code {
background: transparent;
border: 0;
border-radius: 0;
padding: 0;
}
.markdown-source-view.mod-cm6 .HyperMD-codeblock {
background-color: var(--code-background);
}
/* Tables */
.markdown-rendered .table-wrapper {
overflow-x: auto;
overscroll-behavior-inline: contain;
}
.markdown-rendered table,
.markdown-source-view.mod-cm6 .cm-table-widget table {
border: 1px solid var(--background-modifier-border);
border-collapse: separate;
border-radius: var(--radius-m);
border-spacing: 0;
overflow: hidden;
}
.markdown-rendered th,
.markdown-source-view.mod-cm6 .cm-table-widget th {
background: var(--background-secondary);
color: var(--text-normal);
font-weight: 600;
}
.markdown-rendered :is(th, td),
.markdown-source-view.mod-cm6 .cm-table-widget :is(th, td) {
border-color: var(--background-modifier-border);
padding: 0.55em 0.7em;
vertical-align: top;
}
/* Sidebar and core navigation */
.workspace-split.mod-left-split,
.workspace-split.mod-right-split {
-webkit-backdrop-filter: blur(16px);
backdrop-filter: blur(16px);
background: var(--weiya-sidebar-background);
}
.workspace-split.mod-left-split {
border-right-color: var(--weiya-divider);
}
.workspace-split.mod-right-split {
border-left-color: var(--weiya-divider);
}
.mod-left-split .workspace-tabs,
.mod-right-split .workspace-tabs {
background: transparent;
}
.workspace-tab-header-container {
border-bottom: 1px solid var(--weiya-divider);
}
.nav-file-title,
.nav-folder-title {
border-radius: var(--radius-s);
}
.nav-file-title.is-active {
background: var(--background-modifier-active-hover);
color: var(--text-normal);
font-weight: 500;
}
/* Mobile-safe fallback */
body.is-mobile {
--file-line-width: 100%;
--font-text-size: 16px;
}
body.is-mobile .workspace-split.mod-left-split,
body.is-mobile .workspace-split.mod-right-split {
-webkit-backdrop-filter: none;
backdrop-filter: none;
background: var(--background-secondary);
}
@media (max-width: 720px) {
body {
--file-line-width: 100%;
}
.markdown-rendered :is(th, td),
.markdown-source-view.mod-cm6 .cm-table-widget :is(th, td) {
padding: 0.5em 0.6em;
}
}