Add 's' method to access theme props (#5163)

This commit is contained in:
Tom Moor
2023-04-07 22:43:34 -04:00
committed by GitHub
parent c202198d61
commit 422bdc32d9
116 changed files with 482 additions and 388 deletions

View File

@@ -5,7 +5,7 @@ import { Portal } from "react-portal";
import { useLocation } from "react-router-dom";
import styled, { useTheme } from "styled-components";
import breakpoint from "styled-components-breakpoint";
import { depths } from "@shared/styles";
import { depths, s } from "@shared/styles";
import Flex from "~/components/Flex";
import useMenuContext from "~/hooks/useMenuContext";
import usePrevious from "~/hooks/usePrevious";
@@ -224,7 +224,7 @@ const Backdrop = styled.a`
right: 0;
cursor: default;
z-index: ${depths.sidebar - 1};
background: ${(props) => props.theme.backdrop};
background: ${s("backdrop")};
`;
type ContainerProps = {
@@ -239,9 +239,9 @@ const Container = styled(Flex)<ContainerProps>`
top: 0;
bottom: 0;
width: 100%;
background: ${(props) => props.theme.sidebarBackground};
background: ${s("sidebarBackground")};
transition: box-shadow 100ms ease-in-out, transform 100ms ease-out,
${(props) => props.theme.backgroundTransition}
${s("backgroundTransition")}
${(props: ContainerProps) =>
props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""};
transform: translateX(