惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
SecWiki News
SecWiki News
博客园 - Franky
V
V2EX
罗磊的独立博客
美团技术团队
大猫的无限游戏
大猫的无限游戏
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
C
Cyber Attacks, Cyber Crime and Cyber Security
Hugging Face - Blog
Hugging Face - Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Attack and Defense Labs
Attack and Defense Labs
WordPress大学
WordPress大学
Webroot Blog
Webroot Blog
N
News | PayPal Newsroom
博客园 - 司徒正美
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Hacker News - Newest:
Hacker News - Newest: "LLM"
Cloudbric
Cloudbric
AI
AI
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
Recent Commits to openclaw:main
Recent Commits to openclaw:main
月光博客
月光博客
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Troy Hunt's Blog
Project Zero
Project Zero
Schneier on Security
Schneier on Security
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
P
Privacy & Cybersecurity Law Blog
博客园_首页
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
P
Proofpoint News Feed

Obsidian Blog

Obsidian Sync audits by Cure53 and Trail of Bits The future of Obsidian plugins Obsidian October 2025 Less is safer: how Obsidian reduces the risk of supply chain attacks Obsidian is now free for work 2024 Gems of the year winners 2024 Gems of the year nominations Second audit of Obsidian apps completed by Cure53 Obsidian Softwear: new Fractal t-shirts and hoodies Save the web Obsidian October 2024 Obsidian Sync now starts at $4 per month with the new Standard plan Announcing JSON Canvas: an open file format for infinite canvas data 2023 Gems of the year winners New security page and independent audit completed by Cure53 2023 Gems of the year nominations New Obsidian Sync plans: bigger, better, faster, smoother Goodbye legacy editor Obsidian Importer now converts Apple Notes to portable, durable files Obsidian October 2023 Free your notes How to verify Obsidian Sync's end-to-end encryption The new Obsidian icon New developer documentation site Obsidian Publish now offers more for less: a lower price, with new features, improved SEO and accessibility 2022 Gems of the year winners I’m joining Obsidian full-time as CEO New Code of Conduct for our community 2022 Gems of the year nominations Obsidian October 2022 winners Obsidian October 2022 How to update your plugin to support pop-out windows Plugin developers: CodeMirror 6 migration guide for v6.0 2021 Gems of the year winners Live Preview update 2021 Gems of the year nominations Obsidian October 2021 winners Obsidian October 2021: make plugins and themes together and win awards! Last chance to get early bird discount for Sync and Publish 2020 Gems of the year winners 2020 Gems of the year nominations
1.0 Theme migration guide
kepano · 2022-08-29 · via Obsidian Blog

Overview

Obsidian 1.0 introduces a new default theme, a new theme versioning system, and several important new features. We expect that most themes and plugins will need some tweaks.

  • Migrating your theme to the new versioning system
  • How to design themes for v1.0+
  • New v1.0 features and modes to consider
  • Design guidelines

Migrating your theme to the new versioning system

Because v1.0 contains a lot of breaking changes, we are taking this time to reset our theme gallery and improve how themes are loaded in Obsidian going forward.

Themes that are not compatible with v1.0 have been flagged in the community-css-themes.json file as "legacy." Legacy themes are hidden from the gallery until the theme author updates the theme opts to have the flag removed.

Even if your theme made the cut to the new list, we still recommend you take the following steps to prepare your theme for the new version of Obsidian:

  1. Create a copy of your obsidian.css file and rename it to theme.css. Keep the obsidian.css file in your repository so that older versions of Obsidian can continue to download your theme. If you have any preprocessing tools that output the obsidian.css file, make sure to update those as well.
  2. Test your theme on Obsidian 1.0 and apply any issues to theme.css.
  3. Create a manifest.json file in your repository. This file specifies the minAppVersion for your theme, meaning: versions of Obsidian that are older than the version you specify will not be able to install your theme.

Sample Manifest.json

{  
   "name": "Sample Theme",  
   "version": "1.0.0",  
   "minAppVersion": "1.0.0",  
   "author": "Obsidian",  
   "authorUrl": "https://obsidian.md"  
}
  1. Optional: Update your screenshot thumbnail. This should be 16:9 aspect ratio and the recommend size is 512 by 288px.
  2. Update your theme’s README file. Clicking on the theme in the Theme Gallery will now the README file from Github. This means you have more space to promote your theme and can load additional screenshots to showcase different features.
  3. Create a Pull Request on the obsidian-releases repo and remove "legacy": true from your theme entry in community-themes.json.

How to design themes for v1.0+

TLDR: Obsidian 1.0 introduces over 400 new CSS variables that help you style almost every aspect of the Obsidian UI. This enables themes to remove complex selectors and let variables do the heavy lifting.

With the release of Obsidian v1.0 we’ve made it much easier to create custom themes and snippets.

Previously, many of Obsidian’s UI elements could only be targeted by writing complex CSS selectors with high specificity. Several selectors were typically required to target the same element across Reading mode and Live Preview.

With v1.0 we have abstracted most UI elements into CSS variables applied to the body element. You can find an alphabetized list of all the CSS variables at the top of the app.css file. These variables are also designed to provide parity across Reading mode and Live Preview.

Our goal was to make it possible to create highly expressive themes with less specificity in your CSS selectors. Most themes should be able to completely customize the interface by simply targeting body for interface styling, and .theme-light/.theme-dark for colors.

We expect these changes to significantly reduce the number of lines of code in advanced themes. This should reduce maintainance work and make your code more future-proof.

If you are working on a complex theme, consider simplifying your selectors and using the new CSS variables to do the heavy lifting. The new CSS variables should also make it easier to create styles that are responsive to conditional CSS classes.

Summary:

  • Explore the new variables in CSS by looking at app.css and using the Developer Tools
  • Try to use the lowest specificity selectors you can. You may be able to only use body, .theme-light and .theme-dark

New 1.0 features and modes to consider

Obsidian 1.0 contains new features and modes that you should consider in your theme.

Accent color

Users can now customize their accent color. Dynamic variables for accent HSL values --accent-h, --accent-s, --accent-l are provided which can be modified with the CSS calc() function.

If you define these variables in your theme, the user will see your default accent color, and resetting to default will return the user to your specified default accent color.

Title bar style

In Settings > Appearance users can now choose between three different title bar styles:

  • Hidden: no titlebar is displayed, only the the top row of tabs, default in 1.0+
  • Custom: displays a custom titlebar element that can be styled with CSS (previously the default in versions 0.15 and older)
  • Native: displays the native operating system titlebar

Top row of tabs and .mod-top

The top area of the application which includes both the custom titlebar (if enabled) and the top row of tabs is considered a single UI area. The default theme uses a single background color for this top area.

The .mod-top modifier class is added to the top row of tabs in sidebars and panes. Tab containers inside of .mod-top use the --titlebar-background variables rather than --tab-container-background variable.

Sidebars and sidebar buttons

Note: the right ribbon has been removed

Sidebar toggle buttons have moved into the top row of tabs. Depending on the user’s operating system, the window buttons (minimize, maximize, close) may be on the left or right side of the application. When the user set title bar to Hidden, this means the position of the sidebar buttons needs to be accounted for.

Consider the following scenarios, particularly when titlebar is hidden, on macOS vs. Windows:

  • Left sidebar closed
  • Right sidebar closed
  • Popout widow does not have sidebars
  • Fullscreen does not have window buttons

View header

The view header is now disabled by default and the view-header-icon has been removed

Users can re-enable the view header in Appearance settings.

Design guidelines

Starting with 1.0, the default Obsidian experience is designed to be consistent with operating system design guidelines and best practices. Our intention is to make Obsidian feel familiar to new users, and create cohesiveness across the screens and modes of the application.

We encourage plugin developers to follow these design guidelines so that users have a cohesive experience when using the default theme.

Padding, margins and spacing

Obsidian uses a 4 pixel grid. The 4 pixel grid is chosen because it enables the interface to scale up and down across high/low DPI screens, and also provides convenient ratios for layouts.

UI elements use multiples of 4 for padding and spacing throughout the app. We recommend using the --size CSS variables to define all dimensions throughout your plugin.

Each size variable contains two numbers which represent the base and the multiple, for example:

  • --size-4-1 represents 4*1 = 4px
  • --size-4-2 represents 4*2 = 8px
  • --size-4-4 represents 4*4 = 16px

A few --size-2-x variables are available for small spaces where fractions of 4 can be useful, e.g. --size-2-1 represents 2*1 = 2px

Cursor

Obsidian follows operating system conventions for cursors. This means that the pointer cursor is only used when hovering over links. Avoid using the pointer cursor for buttons and interactive elements.

  • Use --cursor variable to follow system conventions
  • Use --cursor-link for links

Icons

Important: In a future update to Obsidian, we will provide a new way for themes to replace icons. For now you should avoid replacing icons via CSS

Obsidian includes the Lucide icon library, which has over 800 icons that you can use for your plugin.

If you are looking to use an icon that is not available in the Lucide library, you can create your own. For best compatibility and cohesiveness with Obsidian, your icons should follow Lucide’s guidelines

  • Icons must be designed on a 24 by 24 pixels canvas
  • Icons must have at least 1 pixel padding within the canvas
  • Icons must have a stroke width of 2 pixels
  • Icons must use round joins
  • Icons must use round caps
  • Icons must use centered strokes
  • Shapes (such as rectangles) in icons must have border radius of 2 pixels
  • Distinct elements must have 2 pixels of spacing between each other

Lucide also provides templates and guides for vector editors such as Illustrator, Figma, and Inkscape.