Implements color variables and updates components
This commit is contained in:
parent
580e574c84
commit
47b281b754
@ -1,4 +1,5 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import { withContext, Props } from './withContext';
|
import { withContext, Props } from './withContext';
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ const Button =
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
background-color: ${props => props.colors.secondary};
|
background-color: ${props => props.colors.secondary};
|
||||||
color: #000;
|
color: ${variables.colors.black};
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 5rem;
|
border-radius: 5rem;
|
||||||
padding: ${props => (props.large ? '1.125rem 2.375rem' : '.5625rem 1.25rem')};
|
padding: ${props => (props.large ? '1.125rem 2.375rem' : '.5625rem 1.25rem')};
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import BaseButton from './Button';
|
import BaseButton from './Button';
|
||||||
|
|
||||||
@ -25,8 +26,8 @@ const Base =
|
|||||||
styled.div <
|
styled.div <
|
||||||
CodeProps >
|
CodeProps >
|
||||||
`
|
`
|
||||||
color: ${props => (props.language === undefined ? '#FFF' : 'inherit')};
|
color: ${props => (props.language === undefined ? variables.colors.white : 'inherit')};
|
||||||
background-color: ${props => (props.language === undefined ? '#000' : '#F1F4F5')};
|
background-color: ${props => (props.language === undefined ? variables.colors.black : variables.colors.lightGray)};
|
||||||
white-space: ${props => (props.language === undefined ? 'nowrap' : '')};
|
white-space: ${props => (props.language === undefined ? 'nowrap' : '')};
|
||||||
position: relative;
|
position: relative;
|
||||||
&:hover ${Button} {
|
&:hover ${Button} {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import InlineCode from './InlineCode';
|
import InlineCode from './InlineCode';
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ const Cards = styled.dl`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Card = styled.div`
|
const Card = styled.div`
|
||||||
background-color: #f1f4f5;
|
background-color: ${variables.colors.lightGray};
|
||||||
padding: 3.125rem;
|
padding: 3.125rem;
|
||||||
padding-bottom: 2.5rem;
|
padding-bottom: 2.5rem;
|
||||||
`;
|
`;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
const InlineCode = styled.code`
|
const InlineCode = styled.code`
|
||||||
background-color: #eceff9;
|
background-color: ${variables.colors.blueGray}
|
||||||
padding: 0.1875rem;
|
padding: 0.1875rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import { Alpha, Beta } from './Typography';
|
import { Alpha, Beta } from './Typography';
|
||||||
|
|
||||||
const Main = styled.div`
|
const Main = styled.div`
|
||||||
background-color: #f1f4f5;
|
background-color: ${variables.colors.lightGray};
|
||||||
padding: 6.25rem;
|
padding: 6.25rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -16,13 +17,12 @@ const Title = styled(Alpha)`
|
|||||||
|
|
||||||
const Content = styled.div`
|
const Content = styled.div`
|
||||||
max-width: 25.9375rem;
|
max-width: 25.9375rem;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Code = styled.div`
|
const Code = styled.div`
|
||||||
background-color: #e9eced;
|
background-color: ${variables.colors.darkGray};
|
||||||
width: 520px;
|
width: 520px;
|
||||||
height: 350px;
|
height: 350px;
|
||||||
`;
|
`;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import { Tabs as ReactTabs, Tab, TabList, TabPanel } from 'react-tabs'
|
import { Tabs as ReactTabs, Tab, TabList, TabPanel } from 'react-tabs'
|
||||||
|
|
||||||
import {withContext, Props} from './withContext';
|
import {withContext, Props} from './withContext';
|
||||||
@ -34,7 +36,7 @@ const Root = styled.div<{primaryColor: string;}>`
|
|||||||
background-color: ${props => props.primaryColor};
|
background-color: ${props => props.primaryColor};
|
||||||
}
|
}
|
||||||
${StyledTab}[aria-selected="true"] {
|
${StyledTab}[aria-selected="true"] {
|
||||||
background-color: #F1F2F7;
|
background-color: ${variables.colors.gray};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import variables from '../variables';
|
||||||
|
|
||||||
import { withContext, Props } from './withContext';
|
import { withContext, Props } from './withContext';
|
||||||
import { Alpha, Beta, Gamma } from './Typography';
|
import { Alpha, Beta, Gamma } from './Typography';
|
||||||
@ -97,7 +98,7 @@ const StyledSection =
|
|||||||
`
|
`
|
||||||
max-width: 90rem;
|
max-width: 90rem;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
background: linear-gradient(to right, #000 50%, ${props => props.background} 50%);
|
background: linear-gradient(to right, ${variables.colors.black} 50%, ${props => props.background} 50%);
|
||||||
padding-top: 6.25rem;
|
padding-top: 6.25rem;
|
||||||
padding-bottom: 5.25rem;
|
padding-bottom: 5.25rem;
|
||||||
`;
|
`;
|
||||||
|
12
packages/dev-tools-pages/ts/variables.tsx
Normal file
12
packages/dev-tools-pages/ts/variables.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
const variables = {
|
||||||
|
colors: {
|
||||||
|
black: '#000000',
|
||||||
|
white: '#FFFFFF',
|
||||||
|
lightGray: '#F1F4F5',
|
||||||
|
gray: '#F1F2F7',
|
||||||
|
darkGray: '#E9ECED',
|
||||||
|
blueGray: '#ECEFF9',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default variables;
|
Loading…
x
Reference in New Issue
Block a user