Skip to content

Commit fd4f9c6

Browse files
committed
remove styled-react and styled-components
1 parent 67cce8b commit fd4f9c6

File tree

6 files changed

+6
-79
lines changed

6 files changed

+6
-79
lines changed

examples/nextjs/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
},
1212
"dependencies": {
1313
"@primer/react": "38.0.0",
14-
"@primer/styled-react": "0.2.0",
1514
"next": "^15.2.3",
1615
"react": "18.3.1",
1716
"react-dom": "18.3.1",
18-
"styled-components": "5.x",
1917
"typescript": "^5.9.2"
2018
},
2119
"devDependencies": {

examples/nextjs/src/app/global.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
@import '@primer/primitives/dist/css/primitives.css';
22
@import '@primer/primitives/dist/css/functional/themes/light.css';
33
@import '@primer/primitives/dist/css/functional/themes/dark.css';
4-
5-
body {
6-
color: var(--fgColor-default);
7-
background-color: var(--bgColor-default);
8-
}

examples/nextjs/src/app/layout.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import './global.css'
2-
import {ThemeProvider, BaseStyles} from '@primer/styled-react'
3-
import {StyledComponentsRegistry} from './registry'
2+
import {ThemeProvider, BaseStyles} from '@primer/react'
43

54
export const metadata = {
65
title: 'Next.js',
@@ -13,11 +12,9 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
1312
// that cause hydration mismatch errors
1413
<html lang="en" suppressHydrationWarning>
1514
<body>
16-
<StyledComponentsRegistry>
17-
<ThemeProvider>
18-
<BaseStyles>{children}</BaseStyles>
19-
</ThemeProvider>
20-
</StyledComponentsRegistry>
15+
<ThemeProvider colorMode="auto">
16+
<BaseStyles style={{backgroundColor: 'var(--bgColor-default)', height: '100vh'}}>{children}</BaseStyles>
17+
</ThemeProvider>
2118
</body>
2219
</html>
2320
)

examples/nextjs/src/app/page.tsx

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
1-
'use client'
2-
3-
import {Button, Stack} from '@primer/react'
4-
import {useTheme} from '@primer/styled-react'
5-
import styled from 'styled-components'
6-
7-
const StyledDiv = styled.div(({theme}) => {
8-
return {
9-
padding: theme.space[5],
10-
backgroundColor: theme.colors.btn.primary.bg,
11-
}
12-
})
13-
14-
const ThemeUser = () => {
15-
const {theme} = useTheme()
16-
return (
17-
<div
18-
style={{
19-
padding: theme?.space[5],
20-
backgroundColor: theme?.colors.btn.primary.bg,
21-
}}
22-
>
23-
Hello world
24-
</div>
25-
)
26-
}
1+
import {Button} from '@primer/react'
272

283
export default function IndexPage() {
29-
return (
30-
<Stack direction="horizontal">
31-
<Button variant="primary" style={{padding: 'var(--base-size-32)'}}>
32-
Hello world
33-
</Button>
34-
<div style={{padding: 'var(--base-size-32)', backgroundColor: 'var(--button-primary-bgColor-rest)'}}>
35-
Hello world
36-
</div>
37-
<StyledDiv>Hello world</StyledDiv>
38-
<ThemeUser />
39-
</Stack>
40-
)
4+
return <Button>Hello world</Button>
415
}

examples/nextjs/src/app/registry.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

package-lock.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)