Is it possible to split one theme CSS sheet (obsidian.css) in multiple CSS sheets?

Hi !
Is it possible to make an Obsidian theme in multiple files ? I mean to have a main obsidian.css file that use @import to import several other CSS files.
Will Obsidian import all files when someone downloads the theme ? Or does it only allow one CSS file (the obsidian.css one) ?

Thanks in advance for your help,
Lilian.

1 Like

I don’t know if (and I currently don’t think that…) you can use something like an import function. Yet, you can work with css snippets which you can individually activate.

Thanks you for your answer !
The goal is to have a theme easily installable by Obsidian’s users, so CSS snippets are not appropriate in this case :slight_smile:

OK, so your goal is to create a new theme that can be easily customized rather than to customize your own style/appearance?

There may be other people that can deliver more helpful replies, but for the time being you could maybe have a look at kepano’s minimal theme and the respective settings plugin - I never used it but maybe it might deliver some helpful insights? As far as I know it is really highly customizable. Sorry for not being more supportive… :wink:

Actually all the theme I know are only built with one CSS file called obsidian.css
For example the Harmonic Theme where you can see that there is obsidian.css file with 6143 lines !!

So my goal is to be able to split this obsidian.css file in several files to to allow easier collaboration on the theme :

  • People can work on different files without conflicts
  • The project is more accessible and easier to understand for new contributors
  • It’s easier to maintain in the long term

For example to transform this alone obsidian.css file in :

  • main.css (the main file that import all others CSS files)
  • left-sidebar.css (the CSS file that style the left sidebar)
  • right-sidebar.css (the CSS file that style the right sidebar)
  • notes.css (the CSS file that style the notes in edit and preview mode)
  • etc.
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.