Skip to content

Theming support #10

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
zefhemel opened this issue Jul 14, 2022 · 8 comments
Open

Theming support #10

zefhemel opened this issue Jul 14, 2022 · 8 comments
Labels
core Requires extension of SB’s core enhancement New feature or request help wanted If you're willing to help, do!

Comments

@zefhemel
Copy link
Collaborator

Currently all styles are hard-coded in various SCSS files, we probably will want a theming system.

Plenty of design decisions to be made here:

  • Should themes be defined in plain CSS or e.g. JSON? We’d want to be able to hot load and unload these and likely namespace them somehow.
  • Should themes be plugs, part of plug YAML definitions maybe even, or be something completely different?
  • CodeMirror has its own theming mechanism should we leverage this somehow?
  • Custom syntax in plug YAML can define styling as well, such as colors. How would this interact with themes?
@zefhemel zefhemel added enhancement New feature or request help wanted If you're willing to help, do! core Requires extension of SB’s core labels Jul 14, 2022
@Pinjasaur
Copy link
Contributor

Loosely related to #2. :)

@zefhemel
Copy link
Collaborator Author

Very related indeed

zefhemel added a commit that referenced this issue Aug 2, 2022
@zefhemel zefhemel self-assigned this Aug 5, 2022
@zefhemel
Copy link
Collaborator Author

zefhemel commented Aug 5, 2022

See #58 for a discussion

@zefhemel zefhemel pinned this issue Aug 5, 2022
@zefhemel zefhemel removed their assignment Nov 21, 2022
@simcard0000 simcard0000 mentioned this issue Dec 9, 2022
2 tasks
@kjk
Copy link
Contributor

kjk commented Dec 22, 2022

Roam Research has a nice and easy to use (from user point of view) theming system: you can create a special page roam/css page and put the css as a code block (or @import a .css file from url) and that CSS will-override the built-in CSS.

This is easy to use for users and easy for developers because updating the CSS in that page takes immediate effect in the app so you see changes quickly. It's a live update system.

They also have a bunch of themes created by people (and they are nice).

So one option would be to adopt Roam's CSS classes (to get instant access to their themes) and implement similar system of a special page.

See e.g.:

@zefhemel
Copy link
Collaborator Author

zefhemel commented Dec 23, 2022

Having the CSS classes match is not likely to happen. I do like the idea of embedding styles in a page though, that's a pretty SB style solution... 🤔

@zefhemel zefhemel unpinned this issue Dec 28, 2022
@rktic
Copy link

rktic commented Jan 9, 2023

I have yet to find a theming solution based on utilizing CSS files, that's bearable to use for the average human. Including most of the developers I know, who all passionately hate CSS. :) Even though I love CSS.

That said, I firmly believe there's an accessible, sustainable and scalable approach. Leveraging SCSS variables and a cleverly written CSS framework. For this specific use-case.

Based on having defined the purpose of theming in Silver Bullet. As well as its extend.

Mind you: Nobody ever changes a colour for the sake of changing a colour ;) And I"d like to help defining what that purpose is in the scope of SB, to then figure out a solution that's simple to use for everyone. If anyone's interested.

(I personally challenged myself to create a markdown specific CSS "framework", that's as small and user-friendly as possible. And already found and use an approach to it.)

@firasdib
Copy link
Contributor

I would approach this through css variables. Try to create a minimum set of variables that handle different aspects of the website, and then use that throughout.

This would then be the foundation for any theme, simply stick a bunch of variables into a THEME.md file and go from there.

@onespaceman
Copy link
Contributor

Any interest in reducing the theme to a framework of color variables like so:

--bg0: #eff1f5;
--bg1: #ccd0da;
--bg3: #bcc0cc;
--fg2: #6c6f85;
--fg1: #5c5f77;
--fg0: #4c4f69;
--red: #7287fd;
--red-dark: #1e66f5;
--blue: #209fb5;
--blue-dark #04a5e5;
etc.

I set up the catppuccin theme for myself (here) using their framework, but it's probably not the best for adapting to other color schemes, with colors like flamingo and 3 different shades of blue. Something like gruvbox's or base16 framework is better.

I'll try to keep the default theme as close as possible to the current colors, but this will make it easy to customize, only needing to define the color variables for the light and dark theme, without having to think about individual components.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
core Requires extension of SB’s core enhancement New feature or request help wanted If you're willing to help, do!
Projects
None yet
Development

No branches or pull requests

6 participants