mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
Styling updates
This commit is contained in:
parent
97984c3691
commit
813b1a86fd
@ -100,3 +100,7 @@
|
|||||||
.slim {
|
.slim {
|
||||||
@apply bg-transparent relative overflow-hidden box-border;
|
@apply bg-transparent relative overflow-hidden box-border;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.slim .tag {
|
||||||
|
@apply bg-secondary text-secondary inline-block p-3 font-bold text-xl break-words;
|
||||||
|
}
|
||||||
|
@ -35,9 +35,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
{variant === 'slim' && (
|
{variant === 'slim' && (
|
||||||
<>
|
<>
|
||||||
<div className="absolute inset-0 flex items-center justify-end mr-8 z-20">
|
<div className="absolute inset-0 flex items-center justify-end mr-8 z-20">
|
||||||
<span className="bg-accent-0 text-accent-9 inline-block p-3 font-bold text-xl break-words">
|
<span className={s.tag}>{product.name}</span>
|
||||||
{product.name}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
{product?.images && (
|
{product?.images && (
|
||||||
<Image
|
<Image
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
import s from './Marquee.module.css'
|
import s from './Marquee.module.css'
|
||||||
import { FC, ReactNode, Component } from 'react'
|
import { FC, ReactNode, Component, Children, isValidElement } from 'react'
|
||||||
import Ticker from 'react-ticker'
|
import Ticker from 'react-ticker'
|
||||||
|
|
||||||
interface MarqueeProps {
|
interface MarqueeProps {
|
||||||
@ -26,7 +26,22 @@ const Marquee: FC<MarqueeProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className={rootClassName}>
|
<div className={rootClassName}>
|
||||||
<Ticker offset={80}>
|
<Ticker offset={80}>
|
||||||
{() => <div className={s.container}>{children}</div>}
|
{() => (
|
||||||
|
<div className={s.container}>
|
||||||
|
{Children.map(children, (child) => {
|
||||||
|
if (isValidElement(child)) {
|
||||||
|
return {
|
||||||
|
...child,
|
||||||
|
props: {
|
||||||
|
...child.props,
|
||||||
|
className: cn(child.props.className, `${variant}`),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return child
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</Ticker>
|
</Ticker>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user