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 {
|
||||
@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' && (
|
||||
<>
|
||||
<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">
|
||||
{product.name}
|
||||
</span>
|
||||
<span className={s.tag}>{product.name}</span>
|
||||
</div>
|
||||
{product?.images && (
|
||||
<Image
|
||||
|
@ -1,6 +1,6 @@
|
||||
import cn from 'classnames'
|
||||
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'
|
||||
|
||||
interface MarqueeProps {
|
||||
@ -26,7 +26,22 @@ const Marquee: FC<MarqueeProps> = ({
|
||||
return (
|
||||
<div className={rootClassName}>
|
||||
<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>
|
||||
</div>
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user