1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:46:39 -04:00

type-safe stitches util for fancy link underline color

This commit is contained in:
2022-07-31 11:24:44 -04:00
parent 43d4b2ea46
commit 1c53376988
3 changed files with 26 additions and 18 deletions

View File

@ -1,5 +1,5 @@
import Link, { LinkProps } from "../components/Link";
import { styled, theme, darkTheme, keyframes } from "../lib/styles/stitches.config";
import { styled, theme, darkTheme, keyframes, stitchesConfig } from "../lib/styles/stitches.config";
const ColorfulLink = ({
lightColor,
@ -14,11 +14,11 @@ const ColorfulLink = ({
<Link
css={{
color: lightColor,
setUnderlineVars: { color: lightColor },
...stitchesConfig.utils.setUnderlineColor({ color: lightColor }),
[`.${darkTheme} &`]: {
color: darkColor,
setUnderlineVars: { color: darkColor },
...stitchesConfig.utils.setUnderlineColor({ color: darkColor }),
},
...css,