Andy-set-studio / gorko

A tiny Sass token class generator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What the best way to do themes with gorko?

xavibenjamin opened this issue · comments

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?

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

@hankchizljaw Thanks so much for the nudge in the right direction!

No worries!