diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d1d22a..4d2e2a22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,13 @@ and this project adheres to - 🌐(frontend) Add German translation #255 - ✨(frontend) Add a broadcast store #387 + ## Changed - 🚸(backend) improve users similarity search and sort results #391 - 🌐(backend) add german translation #259 - ♻️(frontend) simplify stores #402 +- ✨(frontend) update $css Box props type to add styled components RuleSet #423 ## Fixed diff --git a/src/frontend/apps/impress/src/components/Box.tsx b/src/frontend/apps/impress/src/components/Box.tsx index 8642ba94..61eb50f1 100644 --- a/src/frontend/apps/impress/src/components/Box.tsx +++ b/src/frontend/apps/impress/src/components/Box.tsx @@ -1,6 +1,6 @@ import { ComponentPropsWithRef, ReactHTML } from 'react'; import styled from 'styled-components'; -import { CSSProperties } from 'styled-components/dist/types'; +import { CSSProperties, RuleSet } from 'styled-components/dist/types'; import { MarginPadding, @@ -15,7 +15,7 @@ export interface BoxProps { $align?: CSSProperties['alignItems']; $background?: CSSProperties['background']; $color?: CSSProperties['color']; - $css?: string; + $css?: string | RuleSet; $direction?: CSSProperties['flexDirection']; $display?: CSSProperties['display']; $effect?: 'show' | 'hide'; @@ -73,7 +73,7 @@ export const Box = styled('div')` ${({ $transition }) => $transition && `transition: ${$transition};`} ${({ $width }) => $width && `width: ${$width};`} ${({ $wrap }) => $wrap && `flex-wrap: ${$wrap};`} - ${({ $css }) => $css && `${$css};`} + ${({ $css }) => $css && (typeof $css === 'string' ? `${$css};` : $css)} ${({ $zIndex }) => $zIndex && `z-index: ${$zIndex};`} ${({ $effect }) => { let effect; diff --git a/src/frontend/apps/impress/src/components/BoxButton.tsx b/src/frontend/apps/impress/src/components/BoxButton.tsx index cb41ebd0..9ba32799 100644 --- a/src/frontend/apps/impress/src/components/BoxButton.tsx +++ b/src/frontend/apps/impress/src/components/BoxButton.tsx @@ -1,4 +1,5 @@ import { ComponentPropsWithRef, forwardRef } from 'react'; +import { css } from 'styled-components'; import { Box, BoxType } from './Box'; @@ -26,7 +27,7 @@ const BoxButton = forwardRef( $background="none" $margin="none" $padding="none" - $css={` + $css={css` cursor: pointer; border: none; outline: none; diff --git a/src/frontend/apps/impress/src/components/Card.tsx b/src/frontend/apps/impress/src/components/Card.tsx index f0dcfa43..95122594 100644 --- a/src/frontend/apps/impress/src/components/Card.tsx +++ b/src/frontend/apps/impress/src/components/Card.tsx @@ -1,4 +1,5 @@ import { PropsWithChildren } from 'react'; +import { css } from 'styled-components'; import { useCunninghamTheme } from '@/cunningham'; @@ -15,7 +16,7 @@ export const Card = ({ { $theme="primary" $variation="600" $size="2rem" - $css={`&:hover {background-color: ${colorsTokens()['primary-100']}; };`} + $css={css` + &:hover { + background-color: ${colorsTokens()['primary-100']}; + } + `} $hasTransition $radius="5px" $padding="tiny" diff --git a/src/frontend/apps/impress/src/features/footer/Footer.tsx b/src/frontend/apps/impress/src/features/footer/Footer.tsx index acc9c970..ff653734 100644 --- a/src/frontend/apps/impress/src/features/footer/Footer.tsx +++ b/src/frontend/apps/impress/src/features/footer/Footer.tsx @@ -1,5 +1,4 @@ import Image from 'next/image'; -import React from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components';