Skip to content

Commit

Permalink
Add note about link to code
Browse files Browse the repository at this point in the history
  • Loading branch information
xypnox committed Feb 8, 2024
1 parent 90b2c93 commit 2d49298
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/blog/themescura/introducing-themescura.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Why? Why not?

## How it works

Source code: [`src/components/themeManager`](https://github.com/xypnox/xypnox.github.io/tree/v2/src/components/themeManager) & [`src/theme.ts`](https://github.com/xypnox/xypnox.github.io/blob/v2/src/theme.ts)

import ThemeGenerate from './theme_generate.svg.astro';

Expand All @@ -106,6 +105,9 @@ import ThemeGenerate from './theme_generate.svg.astro';
</figure>
</div>

> Source code: [`src/components/themeManager`](https://github.com/xypnox/xypnox.github.io/tree/v2/src/components/themeManager) & [`src/theme.ts`](https://github.com/xypnox/xypnox.github.io/blob/v2/src/theme.ts)
> Parts of code are linked in relevant places for context.
Everything starts with the [palette](https://github.com/xypnox/xypnox.github.io/blob/77cbbcdf1893f97f1468e52306edab22996a1632/src/theme.ts#L204-L235). The palette consists of `base` tokens associated with layout and `vars` specific to dark and light mode.

The palette is used to [generate the theme variables](https://github.com/xypnox/xypnox.github.io/blob/77cbbcdf1893f97f1468e52306edab22996a1632/src/theme.ts#L373C1-L393C2). For example, the text color of a button with primary color as background, `--primary-contrast`, is selected by comparing primary color's brightness.
Expand Down

0 comments on commit 2d49298

Please sign in to comment.