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
aca215cbbb
commit
97984c3691
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
.input {
|
.input {
|
||||||
@apply bg-transparent px-3 py-2 appearance-none w-full transition duration-150 ease-in-out pr-10;
|
@apply bg-transparent px-3 py-2 appearance-none w-full transition duration-150 ease-in-out pr-10;
|
||||||
|
|
||||||
@screen sm {
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input::placeholder {
|
||||||
|
@apply text-accent-3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input:focus {
|
.input:focus {
|
||||||
@ -21,3 +21,9 @@
|
|||||||
.icon {
|
.icon {
|
||||||
@apply h-5 w-5;
|
@apply h-5 w-5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@screen sm {
|
||||||
|
.input {
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -96,3 +96,7 @@
|
|||||||
.productImage {
|
.productImage {
|
||||||
@apply transform transition-transform duration-500 object-cover scale-120;
|
@apply transform transition-transform duration-500 object-cover scale-120;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.slim {
|
||||||
|
@apply bg-transparent relative overflow-hidden box-border;
|
||||||
|
}
|
||||||
|
@ -34,9 +34,8 @@ const ProductCard: FC<Props> = ({
|
|||||||
>
|
>
|
||||||
{variant === 'slim' && (
|
{variant === 'slim' && (
|
||||||
<>
|
<>
|
||||||
<div className="relative overflow-hidden box-border ">
|
|
||||||
<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-black text-white inline-block p-3 font-bold text-xl break-words">
|
<span className="bg-accent-0 text-accent-9 inline-block p-3 font-bold text-xl break-words">
|
||||||
{product.name}
|
{product.name}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -51,7 +50,6 @@ const ProductCard: FC<Props> = ({
|
|||||||
{...imgProps}
|
{...imgProps}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.root {
|
.root {
|
||||||
@apply border-b border-accent-2 py-4 flex flex-col;
|
@apply border-b border-accent-2 py-4 flex flex-col outline-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.root {
|
.root {
|
||||||
--row-height: calc(100vh - 88px);
|
|
||||||
@apply grid grid-cols-1 gap-0;
|
@apply grid grid-cols-1 gap-0;
|
||||||
|
--row-height: calc(100vh - 88px);
|
||||||
min-height: var(--row-height);
|
min-height: var(--row-height);
|
||||||
|
|
||||||
@screen lg {
|
@screen lg {
|
||||||
@ -27,9 +27,17 @@
|
|||||||
|
|
||||||
.layoutNormal {
|
.layoutNormal {
|
||||||
@apply gap-3;
|
@apply gap-3;
|
||||||
|
}
|
||||||
|
|
||||||
& > * {
|
@screen md {
|
||||||
min-height: 325px;
|
.layoutNormal > * {
|
||||||
|
max-height: min-content !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@screen lg {
|
||||||
|
.layoutNormal > * {
|
||||||
|
max-height: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
.root {
|
.root {
|
||||||
@apply mx-auto grid grid-cols-1 py-32 gap-4;
|
@apply flex flex-col py-32 mx-auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline {
|
||||||
|
@apply text-accent-0 font-extrabold text-5xl leading-none tracking-tight;
|
||||||
|
}
|
||||||
|
|
||||||
@screen md {
|
@screen md {
|
||||||
@apply grid-cols-2;
|
.root {
|
||||||
|
@apply flex-row items-center justify-center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline {
|
||||||
|
@apply text-6xl max-w-xl text-right leading-10 -mt-3;
|
||||||
|
line-height: 4rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,18 +11,16 @@ interface HeroProps {
|
|||||||
|
|
||||||
const Hero: FC<HeroProps> = ({ headline, description }) => {
|
const Hero: FC<HeroProps> = ({ headline, description }) => {
|
||||||
return (
|
return (
|
||||||
<div className="bg-black">
|
<div className="bg-accent-9 border-b border-t border-accent-2">
|
||||||
<Container>
|
<Container>
|
||||||
<div className={s.root}>
|
<div className={s.root}>
|
||||||
<h2 className="text-4xl leading-10 font-extrabold text-white sm:text-5xl sm:leading-none sm:tracking-tight lg:text-6xl">
|
<h2 className={s.headline}>{headline}</h2>
|
||||||
{headline}
|
<div className="md:ml-6">
|
||||||
</h2>
|
<p className="mt-4 text-xl leading-8 text-accent-2 mb-1 lg:max-w-4xl">
|
||||||
<div className="flex flex-col justify-between">
|
|
||||||
<p className="mt-5 text-xl leading-7 text-accent-2 text-white">
|
|
||||||
{description}
|
{description}
|
||||||
</p>
|
</p>
|
||||||
<Link href="/blog">
|
<Link href="/">
|
||||||
<a className="text-white pt-3 font-bold hover:underline flex flex-row cursor-pointer w-max-content">
|
<a className="text-accent-0 pt-3 font-bold hover:underline flex flex-row cursor-pointer w-max-content">
|
||||||
Read it here
|
Read it here
|
||||||
<RightArrow width="20" heigh="20" className="ml-1" />
|
<RightArrow width="20" heigh="20" className="ml-1" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.root {
|
.root {
|
||||||
@apply w-full relative;
|
@apply w-full relative;
|
||||||
height: 320px;
|
height: 360px;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
.container > * {
|
.container > * {
|
||||||
@apply relative flex-1 px-16 py-4 h-full;
|
@apply relative flex-1 px-16 py-4 h-full;
|
||||||
min-height: 320px;
|
min-height: 360px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary {
|
.primary {
|
||||||
@apply bg-white;
|
@apply bg-accent-0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary {
|
.secondary {
|
||||||
@apply bg-black;
|
@apply bg-accent-9;
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
@apply outline-none;
|
@apply outline-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actions:disabled {
|
||||||
|
@apply cursor-not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
@apply bg-transparent px-4 w-full h-full focus:outline-none;
|
@apply bg-transparent px-4 w-full h-full focus:outline-none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
@apply block;
|
@apply block;
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
270deg,
|
270deg,
|
||||||
var(--accent-1),
|
var(--accent-0),
|
||||||
var(--accent-2),
|
|
||||||
var(--accent-2),
|
var(--accent-2),
|
||||||
|
var(--accent-0),
|
||||||
var(--accent-1)
|
var(--accent-1)
|
||||||
);
|
);
|
||||||
background-size: 400% 100%;
|
background-size: 400% 100%;
|
||||||
@ -28,9 +28,9 @@
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
270deg,
|
270deg,
|
||||||
var(--accent-1),
|
var(--accent-0),
|
||||||
var(--accent-2),
|
|
||||||
var(--accent-2),
|
var(--accent-2),
|
||||||
|
var(--accent-0),
|
||||||
var(--accent-1)
|
var(--accent-1)
|
||||||
);
|
);
|
||||||
background-size: 400% 100%;
|
background-size: 400% 100%;
|
||||||
|
@ -4,13 +4,13 @@ import px from '@lib/to-pixels'
|
|||||||
import s from './Skeleton.module.css'
|
import s from './Skeleton.module.css'
|
||||||
|
|
||||||
interface SkeletonProps {
|
interface SkeletonProps {
|
||||||
width?: string | number
|
|
||||||
height?: string | number
|
|
||||||
boxHeight?: string | number
|
|
||||||
style?: CSSProperties
|
|
||||||
show?: boolean
|
show?: boolean
|
||||||
block?: boolean
|
block?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
|
style?: CSSProperties
|
||||||
|
width?: string | number
|
||||||
|
height?: string | number
|
||||||
|
boxHeight?: string | number
|
||||||
}
|
}
|
||||||
|
|
||||||
const Skeleton: React.FC<SkeletonProps> = ({
|
const Skeleton: React.FC<SkeletonProps> = ({
|
||||||
|
@ -5,7 +5,7 @@ export type ProductImage = {
|
|||||||
|
|
||||||
export type ProductPrice = {
|
export type ProductPrice = {
|
||||||
value: number
|
value: number
|
||||||
currencyCode?: 'USD' | 'ARS' | string
|
currencyCode?: 'USD' | 'EUR' | 'ARS' | string
|
||||||
retailPrice?: number
|
retailPrice?: number
|
||||||
salePrice?: number
|
salePrice?: number
|
||||||
listPrice?: number
|
listPrice?: number
|
||||||
|
59
package.json
59
package.json
@ -19,65 +19,62 @@
|
|||||||
"node": "14.x"
|
"node": "14.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reach/portal": "^0.11.2",
|
"@reach/portal": "^0.15.0",
|
||||||
"@react-spring/web": "^9.2.1",
|
"@react-spring/web": "^9.2.1",
|
||||||
"@vercel/fetch": "^6.1.0",
|
"@vercel/fetch": "^6.1.0",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.6",
|
||||||
"body-scroll-lock": "^3.1.5",
|
"body-scroll-lock": "^3.1.5",
|
||||||
"bowser": "^2.11.0",
|
"bowser": "^2.11.0",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.3.1",
|
||||||
"cookie": "^0.4.1",
|
"cookie": "^0.4.1",
|
||||||
"dot-object": "^2.1.4",
|
"dot-object": "^2.1.4",
|
||||||
"email-validator": "^2.0.4",
|
"email-validator": "^2.0.4",
|
||||||
"immutability-helper": "^3.1.1",
|
"immutability-helper": "^3.1.1",
|
||||||
"js-cookie": "^2.2.1",
|
"js-cookie": "^2.2.1",
|
||||||
"keen-slider": "^5.2.4",
|
"keen-slider": "^5.4.1",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"lodash.random": "^3.2.0",
|
"lodash.random": "^3.2.0",
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"next": "^10.0.9-canary.5",
|
"next": "10.0.9-canary.5",
|
||||||
"next-seo": "^4.11.0",
|
"next-seo": "^4.24.0",
|
||||||
"next-themes": "^0.0.4",
|
"next-themes": "^0.0.14",
|
||||||
"postcss": "^8.2.8",
|
"postcss": "^8.3.0",
|
||||||
"postcss-nesting": "^7.0.1",
|
"postcss-nesting": "^8.0.1",
|
||||||
"react": "^17.0.1",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.1",
|
"react-dom": "^17.0.2",
|
||||||
"react-merge-refs": "^1.1.0",
|
"react-merge-refs": "^1.1.0",
|
||||||
"react-ticker": "^1.2.2",
|
"react-ticker": "^1.2.2",
|
||||||
"react-use-measure": "^2.0.4",
|
"react-use-measure": "^2.0.4",
|
||||||
"shopify-buy": "^2.11.0",
|
"shopify-buy": "^2.11.0",
|
||||||
"swell-js": "^4.0.0-next.0",
|
"swell-js": "^4.0.0-next.0",
|
||||||
"swr": "^0.4.0",
|
"swr": "^0.5.6",
|
||||||
"tabbable": "^5.1.5",
|
"tabbable": "^5.2.0",
|
||||||
"tailwindcss": "^2.0.4"
|
"tailwindcss": "^2.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@graphql-codegen/cli": "^1.20.0",
|
"@graphql-codegen/cli": "^1.21.5",
|
||||||
"@graphql-codegen/schema-ast": "^1.18.1",
|
"@graphql-codegen/schema-ast": "^1.18.3",
|
||||||
"@graphql-codegen/typescript": "^1.19.0",
|
"@graphql-codegen/typescript": "^1.22.1",
|
||||||
"@graphql-codegen/typescript-operations": "^1.17.13",
|
"@graphql-codegen/typescript-operations": "^1.18.0",
|
||||||
"@manifoldco/swagger-to-ts": "^2.1.0",
|
"@next/bundle-analyzer": "^10.2.3",
|
||||||
"@next/bundle-analyzer": "^10.0.1",
|
|
||||||
"@tailwindcss/jit": "^0.1.3",
|
|
||||||
"@types/body-scroll-lock": "^2.6.1",
|
"@types/body-scroll-lock": "^2.6.1",
|
||||||
"@types/classnames": "^2.2.10",
|
|
||||||
"@types/cookie": "^0.4.0",
|
"@types/cookie": "^0.4.0",
|
||||||
"@types/js-cookie": "^2.2.6",
|
"@types/js-cookie": "^2.2.6",
|
||||||
"@types/lodash.debounce": "^4.0.6",
|
"@types/lodash.debounce": "^4.0.6",
|
||||||
"@types/lodash.random": "^3.2.6",
|
"@types/lodash.random": "^3.2.6",
|
||||||
"@types/lodash.throttle": "^4.1.6",
|
"@types/lodash.throttle": "^4.1.6",
|
||||||
"@types/node": "^14.14.16",
|
"@types/node": "^15.6.1",
|
||||||
"@types/react": "^17.0.0",
|
"@types/react": "^17.0.8",
|
||||||
"@types/shopify-buy": "^2.10.5",
|
"@types/shopify-buy": "^2.10.5",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"graphql": "^15.4.0",
|
"graphql": "^15.5.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^6.0.0",
|
||||||
"lint-staged": "^10.5.3",
|
"lint-staged": "^11.0.0",
|
||||||
"next-unused": "^0.0.3",
|
"next-unused": "^0.0.6",
|
||||||
"postcss-flexbugs-fixes": "^4.2.1",
|
"postcss-flexbugs-fixes": "^5.0.2",
|
||||||
"postcss-preset-env": "^6.7.0",
|
"postcss-preset-env": "^6.7.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.3.0",
|
||||||
"typescript": "^4.0.3"
|
"typescript": "4.2.4"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
@ -17,11 +17,13 @@ export async function getStaticProps({
|
|||||||
const config = { locale, locales }
|
const config = { locale, locales }
|
||||||
const { pages } = await commerce.getAllPages({ config, preview })
|
const { pages } = await commerce.getAllPages({ config, preview })
|
||||||
const { categories } = await commerce.getSiteInfo({ config, preview })
|
const { categories } = await commerce.getSiteInfo({ config, preview })
|
||||||
|
|
||||||
const { product } = await commerce.getProduct({
|
const { product } = await commerce.getProduct({
|
||||||
variables: { slug: params!.slug },
|
variables: { slug: params!.slug },
|
||||||
config,
|
config,
|
||||||
preview,
|
preview,
|
||||||
})
|
})
|
||||||
|
console.log(product?.variants[0])
|
||||||
|
|
||||||
const { products: relatedProducts } = await commerce.getAllProducts({
|
const { products: relatedProducts } = await commerce.getAllProducts({
|
||||||
variables: { first: 4 },
|
variables: { first: 4 },
|
||||||
|
@ -353,11 +353,7 @@ export default function Search({
|
|||||||
) : (
|
) : (
|
||||||
<Grid layout="normal">
|
<Grid layout="normal">
|
||||||
{rangeMap(12, (i) => (
|
{rangeMap(12, (i) => (
|
||||||
<Skeleton
|
<Skeleton key={i} />
|
||||||
key={i}
|
|
||||||
className="w-full animated fadeIn"
|
|
||||||
height={480}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user