# obsidian-style-tuner
**Repository Path**: sofqi/obsidian-style-tuner
## Basic Information
- **Project Name**: obsidian-style-tuner
- **Description**: A dynamic user interface for adjusting theme, plugin, and snippet CSS variables within Obsidian
- **Primary Language**: TypeScript
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-09-14
- **Last Updated**: 2026-10-09
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Style Tuner
像调音台一样,精细调校你的 Obsidian 外观。
[](https://github.com/Dyse-Sofqi/obsidian-style-tuner/releases) [](LICENSE) [](https://obsidian.md) [](https://github.com/Dyse-Sofqi/obsidian-style-tuner)
---
> 中文为主文档语言,关键章节附英文对照;`/* @settings` 参考文档见文末(英文)。
> Chinese is the primary language, with English alongside in key sections; the `/* @settings` reference is at the bottom of this document.
📜 完整更新记录见 [CHANGELOG](CHANGELOG.md) · Full changelog: [CHANGELOG](CHANGELOG.md)
### 关键词 / Keywords
**中文**:主题变量调校 · CSS 片段可视化配置 · 独立标签页视图 · 外观面板(颜色模式 / 主题切换)· CSS 片段启停管理 · 打开片段文件夹 · 颜色选择器(亮/暗双模式)· 数值滑块 · 下拉选择 · 类开关 · 标题层级折叠 · 搜索过滤 · **按变量名搜索** · 变量名一键复制 · `@settings` 生态兼容 · 界面美化 · 已修改值高亮 · 两栏导出弹窗 · 按区块导出 / 导入 · 24 种界面语言 · **Markdown 美化与 Lint(Obsidian Linter 引擎集成)** · **列表设置项拖拽排序** · **YAML 键属性类型(文本 / 列表 / 数字 / 复选框 / 日期 / 日期时间)** · **YAML 键顺序一键继承** · **与 obsidian-linter 插件共存**
**English**: theme variable fine-tuning · visual CSS snippet configuration · standalone tabbed view · appearance panel (color mode / theme switching) · CSS snippet enable-disable management · open snippets folder · dual-mode color pickers (light/dark) · number sliders · dropdown selects · class toggles · collapsible heading groups · search filter · **search by variable name** · one-click variable-name copy · `@settings` ecosystem compatibility · beautified UI · modified-value highlighting · two-column export dialog · per-section export/import · 24 UI languages · **markdown linting & formatting (Obsidian Linter engine, ported)** · **drag-to-reorder list settings** · **YAML property types (text / list / number / checkbox / date / datetime)** · **one-click inherit of a YAML key order** · **coexists with the obsidian-linter plugin**
### 简介 / Introduction
**中文**:Style Tuner 是一款 Obsidian 插件,让主题、CSS 片段与插件 CSS 声明一组可配置项,并把这些可调设置集中在同一个设置面板里:支持在 `body` 上开关类名,以及设置数值、文本、颜色等 CSS 变量——无需手动改 CSS,主题调校所见即所得。除了样式变量,面板还接管了 Obsidian 原生外观设置中的三件事:颜色模式(跟随系统 / 亮色 / 深色)、主题切换,以及 CSS 片段的启停管理——既可以作为插件设置页打开,也可以作为独立标签页打开,边调边看。它是 [Style Settings](https://github.com/mgmeyers/obsidian-style-settings)(作者 [mgmeyers](https://github.com/mgmeyers))的独立维护分支,遵循 GPL-3.0 协议,解析与原版完全相同的 `/* @settings` 配置块,现有主题与片段无需任何修改即可使用。自 1.2.0 起,它还内置了 [Obsidian Linter](https://github.com/platers/obsidian-linter)(作者 [platers / Victor Tao](https://github.com/platers),MIT 协议)的 Markdown 美化与格式化引擎,其全部设置项集成在面板标签组(格式化 / YAML规范 / 内容规范 / 空行规范 / 自定义规范)中,并附一组命令使用。内置 Linter 占用的全局命名空间已全部收窄到本插件前缀下(视图类型、CSS 类、图标 id),**因此可以与 obsidian-linter 插件同时启用,不再互相顶掉**。YAML 相关设置也做了增强:「插入 YAML 属性」的键可以指定属性类型(并登记进 Obsidian 的属性面板),「YAML 键排序」能一键继承它的键顺序,所有列表设置项都支持拖拽排序。**它是独立插件,不要与 Style Settings 同时启用。**
**English**: Style Tuner is an Obsidian plugin that lets themes, CSS snippets, and plugin CSS declare a set of configurable options, and collects them into a single settings panel: toggle classes on `body`, and set numeric, text, or color CSS variables — no hand-editing CSS, WYSIWYG theme tuning. Beyond style variables, the panel also takes over three native Obsidian appearance settings: color mode (system / light / dark), theme switching, and CSS snippet management — usable either as a plugin settings tab or as a standalone view, so you can tune and preview side by side. It is an independently maintained fork of [Style Settings](https://github.com/mgmeyers/obsidian-style-settings) by [mgmeyers](https://github.com/mgmeyers), licensed under GPL-3.0. It parses the exact same `/* @settings` blocks, so existing themes and snippets work unchanged. Since 1.2.0, it also bundles the markdown styling & formatting engine of [Obsidian Linter](https://github.com/platers/obsidian-linter) by [platers / Victor Tao](https://github.com/platers) (MIT licensed), with all of its settings integrated into the panel tabs (Format / YAML Rules / Content Rules / Blank-line Rules / Custom Rules) plus a set of commands. Every global namespace the bundled linter used to occupy (view types, CSS classes, icon ids) is now namespaced under this plugin, **so it can be enabled alongside the obsidian-linter plugin without the two knocking each other out**. The YAML settings got extra work too: keys added by "Insert YAML attributes" can carry a property type (registered with Obsidian's property panel), "YAML key sort" can inherit that key order in one click, and every list setting supports drag-to-reorder. **It is a separate plugin — do not enable it together with Style Settings.**
### 功能 / Features
**中文**:
- **生态兼容** — 完整支持 `/* @settings` 配置块:标题层级、类开关、类下拉、文本/数值/滑块/下拉变量、单色与亮暗双色取色器、信息文本、颜色渐变,以及按语言后缀的多语言标题(`title.zh`、`title.de` 等)。`parse-style-settings` 事件与 `style-settings-*` 类名沿用原版,主题与插件无需改动。
- **两处入口,界面一致** — 命令「打开 Style Tuner 视图」把面板作为标签页打开;「设置 → 第三方插件 → Style Tuner」的设置页与它完全相同:顶部是搜索框、颜色模式(跟随系统 / 亮色 / 深色)与主题下拉、导入导出按钮,下方分「样式设置」与「CSS 片段」两个标签页;在侧栏这种窄宽度下也能用。
- **外观设置接管** — 颜色模式与主题(默认主题 + 已安装主题)可直接在视图或插件设置页里切换,切换后样式设置面板会自动重新解析,无需来回跳 Obsidian 外观设置。
- **CSS 片段管理** — 「CSS 片段」标签页列出库 `snippets` 目录中的全部片段并显示数量,逐项开关启停、可手动刷新列表,并能在系统文件管理器中直接打开片段文件夹(刷新与打开文件夹是列表标题行的图标按钮,悬停有提示;目录不存在时自动创建;桌面端专属的打开文件夹,移动端隐藏)。
- **变量名一键复制** — 每个变量设置项标题旁显示等宽 `--变量名` chip,单击即复制到剪贴板(成功/失败均有通知);变量名直接取设置项 id,不依赖本地化标题文本。
- **按变量名搜索** — 搜索框除标题与描述外还匹配设置项 id:变量设置输入 `--ribbon-padding` 或 `ribbon-padding` 都能搜到,类开关可输入类名(如 `wide-tables`);命中后计数与自动展开行为与按标题搜索一致。装过 Settings Search 插件的话,它的全局设置搜索里也能按变量名命中。
- **窄宽度也排得整齐** — 工具栏为垂直滚动条预留宽度,CSS 片段列表变长不会把「颜色模式 / 主题」两个下拉挤到第二行;空间实在不够时整行换行(搜索框独占一行、控件落到第二行),极窄容器(侧栏 / 移动端)下两个控件各占一行。
- **界面美化** — 可折叠标题按层级着色、树形缩进线呈现嵌套关系、设置项横向布局、设置页自动加宽,深浅色主题自适应。
- **已自定义值高亮** — 改过默认值的设置行实时亮起标记,重置后立即熄灭。
- **导出/导入增强** — 「全部设置」导出时可按一级区块勾选(默认只勾选来源仍启用的区块,来源已停用的残留配置默认不导出,但会列出来供手动勾选),只导出所选区块及其后代;导出弹窗为左右两栏(左侧勾选区块、右侧看配置文本),窗口更大、区块列表可滚动,底部按钮均为 Obsidian 原生按钮。
- **内置 Markdown 美化引擎** — 集成 Obsidian Linter(MIT)的 66 条格式化规则与 lint 命令,全部设置项收纳进面板标签组,细节见下文「Linter 集成」。
- **列表设置项可拖拽排序** — 所有可增删的列表(要插入的键、各类忽略列表、自定义正则替换、优先级排序……)每行左侧都有拖拽手柄,拖到目标位置即可重排,落点会画一条强调色指示线;拖拽只从手柄发起,行内选中文本或点击按钮都不会误触发。
- **YAML 键管理增强** — 「插入 YAML 属性」的每个键可选**属性类型**(文本 / 列表 / 数字 / 复选框 / 日期 / 日期时间,与 Obsidian 属性面板一致):插入的值按类型生成合法 YAML(列表展开成块序列、数字与布尔不加引号、含冒号的值自动加引号),类型同时登记进 `/types.json` 让属性面板直接按该类型显示(`aliases` / `tags` / `cssclasses` 的类型被 Obsidian 写死,界面里锁定为「列表」并跳过登记);「YAML 键排序」的优先级顺序可用「继承『要插入的键』」按钮一键并入,之后照常增删调序。YAML 标签页里「插入 YAML 属性 / YAML 键排序 / YAML 标题」三条固定排在最前。
- **与 obsidian-linter 插件共存** — 内置 Linter 原先照抄了上游写入 Obsidian **全局命名空间**的标识(视图类型、CSS 类、图标 id),两者同时启用时后加载的那个会整个 onload 中断(`Attempting to register an existing view type`)。现在全部收窄到 `style-tuner-` 前缀下,两个插件可以同时启用。
- **合规** — 不创建动态 `