Skip to content

Commit 0c18856

Browse files
committed
Next example: simplify styles to match Vite's
1 parent 892b3f4 commit 0c18856

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

examples/pigment-css-nextjs-ts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pigment CSS - Next.js App Router with TypeScript example project
22

3-
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/HEAD/packages/create-next-app), with TypeScript and MUI's zero-runtime CSS-in-JS installed.
3+
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/HEAD/packages/create-next-app), with TypeScript and Pigment CSS, a zero-runtime CSS-in-JS library, installed.
44

55
## How to use
66

examples/pigment-css-nextjs-ts/src/app/page.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as React from 'react';
2-
import { Kalnia, Josefin_Sans } from 'next/font/google';
32
import { styled, css, keyframes } from '@pigment-css/react';
43

5-
const kalnia = Kalnia({ subsets: ['latin'] });
6-
const josefin = Josefin_Sans({ subsets: ['latin'] });
7-
84
const scale = keyframes({
95
to: { scale: 'var(--s2)' },
106
});
@@ -14,9 +10,9 @@ const Link = styled('a', { shouldForwardProp: (prop) => prop !== 'outlined' })<{
1410
}>(({ theme }) => ({
1511
fontSize: '1rem',
1612
background: 'rgba(0 0 0 / 0.04)',
17-
padding: '0.5rem 1rem',
13+
padding: '0.8rem 1rem',
1814
letterSpacing: '1px',
19-
borderRadius: '4px',
15+
borderRadius: '8px',
2016
textAlign: 'center',
2117
...theme.applyStyles('dark', {
2218
background: 'rgba(255 255 255 / 0.1)',
@@ -76,9 +72,9 @@ export default function Home() {
7672
>
7773
<h1
7874
className={`
79-
${kalnia.className}
8075
${css(({ theme }) => ({
81-
fontSize: 'clamp(3rem, 1.9503rem + 4.4789vw, 6.25rem)',
76+
fontFamily: 'system-ui, sans-serif',
77+
fontSize: '4rem',
8278
fontWeight: 500,
8379
textAlign: 'center',
8480
position: 'relative',
@@ -158,11 +154,9 @@ export default function Home() {
158154
</h1>
159155
<div
160156
className={`
161-
${josefin.className}
162157
${css({
158+
fontFamily: 'system-ui, sans-serif',
163159
letterSpacing: '2px',
164-
fontSize: 'clamp(0.75rem, 0.5885rem + 0.6891vw, 1.25rem)',
165-
textTransform: 'uppercase',
166160
fontWeight: 500,
167161
opacity: 0.5,
168162
lineHeight: 2,

0 commit comments

Comments
 (0)