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

Normalise border radii across components #7

Merged
merged 1 commit into from
Jan 11, 2019
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
4 changes: 2 additions & 2 deletions src/components/Alert/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled, { css } from 'styled-components'
import { color, space, fontWeight, transition } from '../../theme'
import { color, space, fontWeight, transition, radius } from '../../theme'
import { Icon } from '../Icon'

const Container = styled.div`
Expand All @@ -13,7 +13,7 @@ const Container = styled.div`
: props.variant === 'warning'
? color.sunLightest
: color.earthLightest};
border-radius: ${space[4]};
border-radius: ${radius.md};
min-height: ${space[56]};
display: flex;
align-items: flex-start;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Banner/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled, { css } from 'styled-components'
import { color, space, device } from '../../theme'
import { color, space, device, radius } from '../../theme'
import { Icon } from '../Icon'
import { Box } from '../Box'

Expand Down Expand Up @@ -35,7 +35,7 @@ const StyledBanner = styled.a`
@media ${device.tablet} {
padding-left: ${space[32]};
padding-right: ${space[16]};
border-radius: ${space[4]};
border-radius: ${radius.md};
width: auto;
left: auto;
right: auto;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Spinner } from '../Spinner'
import {
color,
space,
radius,
fontSize,
fontWeight,
lineHeight,
Expand All @@ -27,7 +28,7 @@ const StyledButton = styled.button`
background-color: ${color.earth};
color: white;
line-height: ${lineHeight.solid};
border-radius: ${props => (props.rounded ? space[32] : space[4])};
border-radius: ${props => (props.rounded ? space[32] : radius.md)};
glenngijsberts marked this conversation as resolved.
Show resolved Hide resolved
font-size: ${props => (props.size === 'small' ? fontSize[16] : fontSize[18])};
width: ${props =>
props.width === 'full'
Expand Down
5 changes: 3 additions & 2 deletions src/components/CustomDropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
fontWeight,
lineHeight,
transition,
radius,
} from '../../theme'

export const Menu = styled.ul`
Expand All @@ -19,7 +20,7 @@ export const Menu = styled.ul`
list-style: none;
left: 50%;
transform: translateX(-50%);
border-radius: ${space[8]};
border-radius: ${radius.md};
display: block;
box-shadow: ${shadow.strong};
background-color: white;
Expand All @@ -46,7 +47,7 @@ export const Item = styled.li`
font-size: ${fontSize[24]};
line-height: ${lineHeight.title};
padding: ${space[4]} ${space[8]};
border-radius: ${space[4]};
border-radius: ${radius.sm};
font-weight: ${fontWeight.regular};
white-space: nowrap;
color: ${props =>
Expand Down
13 changes: 10 additions & 3 deletions src/components/Dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { Transition } from 'react-spring'
import PropTypes from 'prop-types'
import { Portal } from '../Portal'
import { callAll, stopPropagation } from '../../utils'
import { space, device, sizes, fontWeight, easingFunctions } from '../../theme'
import {
space,
device,
sizes,
fontWeight,
easingFunctions,
radius,
} from '../../theme'

const Overlay = styled.div`
position: fixed;
Expand All @@ -29,11 +36,11 @@ const Overlay = styled.div`
const Content = styled.div`
width: 100%;
background-color: white;
border-radius: ${space[8]} ${space[8]} 0 0;
border-radius: ${radius.lg} ${radius.lg} 0 0;

@media ${device.mobileL} {
width: ${sizes.mobileL / 16}em;
border-radius: ${space[8]};
border-radius: ${radius.lg};
}
`

Expand Down
3 changes: 2 additions & 1 deletion src/components/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
transition,
fontSize,
lineHeight,
radius,
} from '../../theme'

const InputWrapper = styled.div`
Expand Down Expand Up @@ -66,7 +67,7 @@ const FieldWrapper = styled.div`
const Field = styled.input`
font-family: inherit;
background-color: ${color.stardust};
border-radius: ${props => (props.rounded ? space[32] : space[4])};
border-radius: ${props => (props.rounded ? space[32] : radius.md)};
glenngijsberts marked this conversation as resolved.
Show resolved Hide resolved
width: 100%;
font-size: ${fontSize[18]};
line-height: ${props =>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Toast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import styled from 'styled-components'
import { Transition, Spring, animated } from 'react-spring'
import { Portal } from '../Portal'
import { space, shadow, device, color } from '../../theme'
import { space, shadow, device, color, radius } from '../../theme'

const Container = styled.div`
position: fixed;
Expand All @@ -27,7 +27,7 @@ const Item = styled(animated.div)`
`

export const Toast = styled.div`
border-radius: ${space[8]};
border-radius: ${radius.lg};
background-color: ${color.stardustLight};
box-shadow: ${shadow.strong};
padding: ${space[16]};
Expand Down
6 changes: 6 additions & 0 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export const space = {
768: '48rem',
}

export const radius = {
sm: space[4],
md: space[8],
lg: space[16],
}

export const easing = {
easeInQuad: 'cubic-bezier(.55, .085, .68, .53)',
easeInCubic: 'cubic-bezier(.550, .055, .675, .19)',
Expand Down