1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-13 19:55:26 -04:00

refactor component styles to use type-safe stitches tokens

https://stitches.dev/docs/typescript#stricter-experience
This commit is contained in:
2022-07-07 13:33:20 -04:00
parent 2c7e266fc3
commit b1a92a2eab
40 changed files with 170 additions and 223 deletions
+5 -5
View File
@@ -1,10 +1,10 @@
import NextLink from "next/link";
import { styled } from "../../lib/styles/stitches.config";
import { styled, theme } from "../../lib/styles/stitches.config";
import { baseUrl } from "../../lib/config";
import type { ComponentProps } from "react";
const StyledLink = styled(NextLink, {
color: "$link",
color: theme.colors.link,
textDecoration: "none",
variants: {
@@ -18,15 +18,15 @@ const StyledLink = styled(NextLink, {
backgroundImage: `linear-gradient($$underlineColor, $$underlineColor)`,
backgroundPosition: "0% 100%",
backgroundRepeat: "no-repeat",
backgroundSize: "0% $borderWidths$underline",
backgroundSize: `0% ${theme.borderWidths.underline}`,
paddingBottom: "0.2rem",
"@media (prefers-reduced-motion: no-preference)": {
transition: "background-size $linkHover",
transition: `background-size ${theme.transitions.linkHover}`,
},
"&:hover": {
backgroundSize: "100% $borderWidths$underline",
backgroundSize: `100% ${theme.borderWidths.underline}`,
},
},
false: {},