What the best way to do themes with gorko?
xavibenjamin opened this issue · comments
Xavi Benjamín commented
I used gorko with my personal site and now I want to make a dark theme. What do you recommend the best way to do that with gorko?
Andy Bell commented
So what I do it create a theme file(s) and use Gorko to implement custom properties. This is a sample from a recent project:
@import 'mixins/dark-mode';
:root {
--color-bg: #{get-color('light')};
--color-bg-rev: #{get-color('dark')};
--color-stroke: #{get-color('dark')};
--color-text: #{get-color('dark')};
--color-text-rev: #{get-color('light')};
--color-underlines: #{get-color('primary-mid')};
}
@include dark-mode() {
--color-bg: #{get-color('dark')};
--color-bg-rev: #{get-color('dark-mid')};
--color-stroke: #{get-color('primary')};
--color-text: #{get-color('light')};
--color-underlines: #{get-color('primary')};
}
The dark mode mixin just accounts for repeated css
Xavi Benjamín commented
@hankchizljaw Thanks so much for the nudge in the right direction!
Andy Bell commented
No worries!