Giter Site home page Giter Site logo

theme-provider-nextjs-chakraui's Introduction

Layout Login (Themes)

Learning build a themes by @rocketseat

πŸ“šStack for learn

using NextJS and Chakra-ui to build theme templates

vercel/next.js

chakra-ui/chakra-ui

πŸ”Ž First Steps to create new Application

yarn create next-app <name-app>

add dependencies of the developments

yarn add typescript @types/react @types/node -D

Install chakra ui lib

yarn add @chakra-ui/core @emotion/core @emotion/styled emotion-theming

✏️ to change

  • index.js to index.tsx
  • _app.js to _app.tsx
  • into index.tsx remove styles imports

πŸ—‘to delete

  • api folder into pages
  • README.md
  • styles folder

πŸš€ Initialize App for developments

yarn dev

Create a ThemeProvider

//theme.ts
import { theme, DefaultTheme } from '@chakra-ui/core';

const customTheme: DefaultTheme = {
	...theme,
};

export default customTheme;
//ThemeContainer.ts
import React from 'react';
import {
	ThemeProvider as ChakraThemeProvider,
	ColorModeProvider,
	CSSReset,
} from '@chakra-ui/core';
import { ThemeProvider as EmotionThemeProvider } from 'emotion-theming';
import theme from '../../styles/theme';

const ThemeContainer: React.FC = ({ children }) => {
	return (
		<ChakraThemeProvider theme={theme}>
			<ColorModeProvider value={'dark'}>
				<EmotionThemeProvider theme={theme}>
					<CSSReset />
					{children}
				</EmotionThemeProvider>
			</ColorModeProvider>
		</ChakraThemeProvider>
	);
};

πŸ“½ Watch the guide (pt-Br)

https://www.youtube.com/watch?v=6TEo2AxW-oQ&t=16s

theme-provider-nextjs-chakraui's People

Contributors

nathanramorim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.