| .github/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| esbuild.config.mjs | ||
| eslint.config.mjs | ||
| LICENSE | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| styles.css | ||
| tsconfig.json | ||
| versions.json | ||
Style Controller
Style Controller is an Obsidian plugin for managing reusable style profiles, path overrides, and visual settings through a native settings interface. It applies profile values as CSS custom properties consumed by the plugin's static stylesheet; it does not edit theme files, snippets, or notes.
Safety warning
This plugin changes appearance by applying scoped CSS custom properties. Test profiles on a small set of notes before assigning broad path overrides. Most blank/default controls remove the corresponding property and allow native Obsidian or theme behavior to continue. Inline and block code backgrounds instead use the Style Controller built-in #fafafa background whenever their custom override is Off.
Features
- Reusable stored style profiles, including a built-in Default profile with native styling plus
#fafafacode backgrounds. - Active global profile settings for typography, headings, links, tables, code, blockquotes, callouts, images, file explorer styling, and custom CSS.
- Path-specific overrides for folders, files, and path-contains matching.
- Static CSS rules with custom properties scoped to active Markdown views and matching file paths.
- Image controls for alignment, width, and whether explicit image sizes are respected.
- Status indicators for style fields: On, Off, and Error.
- Import/export workflows for stored configurations.
Profiles and Default behavior
The Default profile keeps native Obsidian styling except that inline-code and fenced-code backgrounds use Style Controller's built-in #fafafa. Each code background uses one compact color control: Off displays and renders #fafafa, entering a custom color automatically changes it to On, and clearing the field automatically returns it to Off and #fafafa. Stored profiles can be applied to the global settings or used as path-specific overrides. The active profile for a note is resolved from the global settings plus matching enabled overrides in their saved order.
Path overrides
Overrides can match folders, files, or paths containing specific text. Matching paths receive only the modules enabled for that override. Override ordering is preserved, and later matching overrides can layer additional non-blank profile values.
Supported visual fields
Style Controller includes controls for base text, headings, links, tables, inline code, code blocks, blockquotes, callouts, images, file explorer entries, and custom CSS. Blank values produce no CSS declaration for that field; the current theme or Obsidian default remains in control.
Image controls
Image settings include alignment, width, and a control for respecting explicit image sizes. Blank image settings do not emit image CSS.
Applied styles
The plugin uses the packaged styles.css; it does not create runtime stylesheets. It applies scoped classes and CSS custom properties to each Markdown view, clears stale values before resolving a new file or profile, and removes its classes and properties on unload.
Code background smoke test
- Reload Style Controller.
- Confirm Inline bg has only one compact color control.
- Confirm Block bg has only one compact color control.
- Confirm no extra toggle or built-in-default description exists.
- Confirm both show
#fafafaand Off by default. - Confirm both previews render
#fafafa. - Type a custom Inline bg color and confirm it immediately becomes On.
- Clear it and confirm it immediately becomes Off and returns to
#fafafa. - Repeat for Block bg.
- Test Reading view and Live Preview.
- Restart Obsidian and confirm persistence.
- Test light and dark themes.
Privacy and network behavior
Style Controller runs locally. It does not use telemetry, analytics, remote code, remote images, or remote fonts.
Installation
Download the release assets from GitHub and place them in .obsidian/plugins/style-controller/:
main.jsmanifest.jsonstyles.css
Then enable the plugin in Obsidian settings.
Development
npm ci
npm run build
The production build writes main.js.
License
MIT License. See LICENSE.