Skip to content

Commit

Permalink
UI polish
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminsehl committed May 26, 2024
1 parent da65220 commit 1f886a1
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 17 deletions.
5 changes: 4 additions & 1 deletion app/components/hydrogen/new/Text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const heading = cva({
'3xl': ['text-6xl', 'leading-none'], // 60 - 3.75rem
'4xl': ['text-7xl', 'leading-none'], // 72 - 4.5rem
'5xl': ['text-8xl', 'leading-none'], // 96 - 6rem
'6xl': ['text-9xl', 'leading-none'], // 128 - 8rem
},
},
defaultVariants: {
Expand All @@ -174,6 +175,7 @@ export const Heading = forwardRef(
truncate = false,
uppercase = false,
leading = 'tight',
font = 'display',
width,
weight,
align,
Expand All @@ -197,6 +199,7 @@ export const Heading = forwardRef(
leading,
width,
weight,
font,
align,
wrap,
color,
Expand All @@ -215,7 +218,7 @@ export const Heading = forwardRef(
const span = cva({
variants: {
pill: {
true: ['px-[0.4em]', 'py-[0.1em]', 'bg-white', 'rounded-full'],
true: ['px-5', 'rounded-full'],
false: null,
},
},
Expand Down
11 changes: 7 additions & 4 deletions app/routes/products.$handle/sections/highlight-solution.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Heading, Text} from '@h2/new/Text';
import {Heading, Span, Text} from '@h2/new/Text';
import {useLoaderData} from '@remix-run/react';
import {Button} from '@h2/new/Button';
import {Image} from '@shopify/hydrogen';
Expand Down Expand Up @@ -29,10 +29,13 @@ export default function HighlightSolution() {
>
<Heading uppercase wrap="balance">
Your{' '}
<span className="px-5 mx-2 rounded-full bg-accent">ideal</span>
<span className="px-5 mx-2 rounded-full bg-accent">
<Span pill className="bg-accent">
ideal
</Span>
&nbsp;
<Span pill className="w-[1em] px-6 bg-accent">
&nbsp;
</span>{' '}
</Span>{' '}
travel companion
</Heading>
<Text wrap="balance" size="xl" className="opacity-70">
Expand Down
15 changes: 10 additions & 5 deletions app/routes/products.$handle/sections/reviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ const reviews = [
export default function Reviews({data = reviews}) {
return (
<Section>
<Container as="header" className="py-56 -mb-64">
<Container as="header" className="py-56 -mb-96">
<Flex direction="down" gap={8}>
<Heading size={9} uppercase weight="regular" wrap="balance">
<Heading size="6xl" uppercase weight="regular" wrap="balance">
Don’t take our word for it
</Heading>
<Flex direction="down" gap={6}>
Expand All @@ -71,7 +71,7 @@ export default function Reviews({data = reviews}) {
</Flex>
</Container>
<Container className="pb-16">
<div className="max-w-3xl ml-auto">
<div className="max-w-[52rem] ml-auto">
<div className="gap-12 columns-2">
<div className="mt-36" />
{data.map((review, i) => {
Expand Down Expand Up @@ -120,8 +120,13 @@ function Review({data, className, ...props}) {
<IconQuote />
</span>
<Text>
<Strong>{firstSentence}</Strong>{' '}
<Span weight="medium" color="text">
<Strong color={props.background === 'black' ? 'white' : 'text'}>
{firstSentence}
</Strong>{' '}
<Span
color={props.background === 'black' ? 'white' : 'black'}
className="opacity-70"
>
{remainingText}
</Span>
</Text>
Expand Down
10 changes: 8 additions & 2 deletions app/routes/products.builder-keyboard/sections/cta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ export default function CTA() {
>
<Heading weight="regular" leading="normal">
<Span font="display">
<Span pill>CTRL</Span> YOUR PRODUCTIVITY,
<Span pill className="bg-white">
CTRL
</Span>{' '}
YOUR PRODUCTIVITY,
</Span>
<br />
<Span font="sans">
<Span pill>ALT</Span> YOUR WORK GAME.
<Span pill className="bg-white">
ALT
</Span>{' '}
YOUR WORK GAME.
</Span>
</Heading>
<Button>Pre-order</Button>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/products.builder-keyboard/sections/features.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Feature({number, title, description, image}) {
{description}
</Text>
</Flex>
<div className="col-span-3 col-start-7 bg-gray">
<div className="col-span-3 col-start-7 bg-offWhite">
<Image src={image.src} width={370} height={257} crop="center" />
</div>
</Grid>
Expand Down
15 changes: 11 additions & 4 deletions app/routes/products.builder-keyboard/sections/hero.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Button} from '@h2/Button';
import {Button} from '@h2/new/Button';
import Link from '@h2/Link';
import {Price} from '@h2/Price';
import {Heading, Span, Text} from '@h2/new/Text';
Expand All @@ -24,11 +24,18 @@ export default function Hero() {
Keyboard
</Span>
</Heading>
<Price as={Text} size="6xl" variant={selectedVariant} />
<Price
color="white"
className="opacity-60"
font="display"
as={Text}
size="6xl"
variant={selectedVariant}
/>
</Flex>
<Flex direction="down" gap={4}>
<Button>Pre-order</Button>
<Text width="narrow" className="opacity-70">
<Button color="accent">Pre-order</Button>
<Text width="narrow" color="white" className="opacity-70">
See{' '}
<Link className="border-b border-white/45" to="/">
FAQs
Expand Down
8 changes: 8 additions & 0 deletions app/styles/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@font-face {
font-family: "Synchro";
src: url("/synchro.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default {
inherit: 'inherit',
},
fontFamily: {
display: 'Synchro',
sans: ['Helvetica Neue', 'ui-sans-serif', 'system-ui', 'sans-serif'],
serif: ['"IBMPlexSerif"', 'Palatino', 'ui-serif'],
},
Expand Down

0 comments on commit 1f886a1

Please sign in to comment.