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

Add theme provider #312

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions components/HomePage/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

export const Container = styled('div')`
background: #fff;
background: ${({ theme }) => theme.colors.neutral[200]};
font-family: 'Poppins', sans-serif;
`;

Expand Down Expand Up @@ -108,7 +108,7 @@ export const LogoText = styled('p')`
`;

export const InfoCard = styled('div')`
background-color: #04102f;
background-color: ${({ theme }) => theme.colors.neutral[700]};
border-radius: 1rem;
color: #fff;
margin-top: 5rem;
Expand Down
55 changes: 55 additions & 0 deletions global-styles/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const theme = {
colors: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genial! 🙌

primary: {
700: '#02600A',
600: '#287832',
500: '#329628',
400: '#5BC13E',
300: '#96DC8C',
200: '#C8F0C8',
100: '#F0FAFA',
},
secondary: {
600: '#04102F',
500: '#475065',
400: '#8E94A4',
300: '#C7CAD1',
200: '#E3E5E8',
100: '#F7F7F7',
},
neutral: {
700: '#1F1F1F',
600: '#6D6D6D',
500: '#B1B1B1',
400: '#DEDEDE',
300: '#F3F3F3',
200: '#FFFFFF',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perdón por demorarme en llegar a este comentario pero #FFFFFF al ser blanco no debería ser 0?, no me imagino que valor podría tener 100 o 50 en esa nomenclatura. También: negro debería ser 1000?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wixo me estoy guiando de nuestra paleta de colores, donde nuestro máximo valor es 700

image

},
status: {
success: {
700: '#45A73D',
600: '#4BC540',
500: '#6FEC64',
400: '#BAF4B5',
300: '#E3F9E1',
200: '#F7FDF6',
},
warning: {
700: '#807300',
600: '#B3A100',
500: '#FFE500',
400: '#FFF599',
300: '#FFFACC',
},
error: {
700: '#721111',
600: '#C41E1E',
500: '#F86363',
400: '#F8A6A6',
300: '#F9D5D5',
200: '#FDF4F4',
},
},
},
};
export default theme;
6 changes: 5 additions & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Fragment, useEffect } from 'react';
import Head from 'next/head';
import { ThemeProvider } from 'styled-components';
import theme from 'global-styles/theme';
import useHotjar from 'react-use-hotjar';
import { init as initMatomo } from '@openpolitica/matomo-next';

Expand All @@ -9,7 +11,9 @@ function Votu({ Component, pageProps }) {
<Head>
<title>Votu.pe</title>
</Head>
<Component {...pageProps} />
<ThemeProvider theme={theme}>
<Component {...pageProps} />
</ThemeProvider>
</Fragment>
);
}
Expand Down