Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patter global style with style components #54

Merged
merged 12 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="./src/assets/favicon.png">

<title>TechRate</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

<link rel="icon" type="image/png" href="./src/assets/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&&family=Nunito:wght@700&display=swap"
rel="stylesheet" />

<title>TechRate</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
9 changes: 0 additions & 9 deletions src/App.css

This file was deleted.

9 changes: 5 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import "./App.css";
import { ThemeProvider } from "styled-components";
import { theme } from "./themes/themes";
import { defaultTheme } from "./styles/themes/themes";
import Header from "./components/Header/Header";
import Home from "./pages/Home";
import { GlobalStyle } from "./styles/global";

function App() {
return (
<ThemeProvider theme={theme}>
<ThemeProvider theme={defaultTheme}>
<GlobalStyle />
<div className="App">
<Home/>
<Home />
</div>
</ThemeProvider>
);
Expand Down
5 changes: 0 additions & 5 deletions src/index.css

This file was deleted.

1 change: 0 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import Avaliar from './Avaliar'
import HeroSection from './Inicio/HeroSection'
import Reputacao from './Reputacao'
import Sobre from './Sobre/About'
import { Container } from './styles'

const Home: React.FC = () => {
return (
<>
<Container>
<Header />
<HeroSection />
<Sobre />
<Reputacao />
<Avaliar />
<Footer/>
</>
<Footer />
</Container>
)
}

Expand Down
6 changes: 6 additions & 0 deletions src/pages/Home/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import styled from 'styled-components'

export const Container = styled.div`
margin: 0 auto;
max-width: 1440px;
`
14 changes: 14 additions & 0 deletions src/styles/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createGlobalStyle } from 'styled-components'

export const GlobalStyle = createGlobalStyle`
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}

body {
-webkit-font-smoothing: antialiased;
}
`
2 changes: 1 addition & 1 deletion src/themes/themes.ts → src/styles/themes/themes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const theme = {
export const defaultTheme = {
colors: {
primary: {
light: '#f0fd7',
Expand Down