jupyter-book / myst-theme

Packages for creating MyST websites themes using React and Remix
https://jupyter-book.github.io/myst-theme/?path=/docs/components-introduction--docs
MIT License
22 stars 21 forks source link

Move colour choices to theme variables #567

Open agoose77 opened 1 month ago

agoose77 commented 1 month ago

It's not very easy to rebrand / reskin a MyST theme for different colour palettes. We might want to make this easier by exposing colours in a more centralised location.

stevejpurves commented 1 month ago

so the tailwind config could be setup to look to variables that we then default. How would a user injest their preferences / overrides? just via the user defined stylesheet?

agoose77 commented 1 month ago

@stevejpurves I think so. I was originally thinking about the perspective of a theme distributor that wants to just tweak the colours for myst-theme, e.g. @stefanv's use case. That would involve shipping custom styles with the build of the theme template.

stefanv commented 1 month ago

That's how it currently works with PyData Sphinx Theme, as long as you can override vars in a custom stylesheet.

Variable definition: https://github.com/pydata/pydata-sphinx-theme/blob/cff65256eecbd514d6f72a9319f99f0d0eb69183/src/pydata_sphinx_theme/assets/styles/variables/_color.scss#L275

Override: https://github.com/scientific-python/scientific-python-hugo-theme/blob/ccf9433101918513139f622407a1702d5c5b1090/assets/theme-css/dark-mode.css#L13