File tree Expand file tree Collapse file tree 6 files changed +6
-79
lines changed Expand file tree Collapse file tree 6 files changed +6
-79
lines changed Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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- }
Original file line number Diff line number Diff line change 11import './global.css'
2- import { ThemeProvider , BaseStyles } from '@primer/styled-react'
3- import { StyledComponentsRegistry } from './registry'
2+ import { ThemeProvider , BaseStyles } from '@primer/react'
43
54export 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 )
Original file line number Diff line number Diff line change 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
283export 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}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments