Skip to content

Commit

Permalink
fix: fix styles after color updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed Nov 1, 2019
1 parent 8199aba commit 5d3101e
Show file tree
Hide file tree
Showing 34 changed files with 38 additions and 13 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion src/components/Button/Button.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,16 @@ const getLinkStyles = (props: *) => {

const getSizeStyles = (props) => {
if (props.variant === 'link') {
return {};
switch (props.size) {
case 'sm': return {
fontSize: '1.2rem',
lineHeight: '1.4rem',
fontWeight: '400',
};
case 'lg':
case 'md':
default: return {};
}
}

switch (props.size) {
Expand Down Expand Up @@ -419,6 +428,17 @@ const [ButtonTag, theme] = createThemeTag(name, ({ COLORS, SIZES, FONTS }: *) =>
'& i': {
width: '20px',
height: '20px',

'&:not(:last-child)': {
marginRight: '8px',
},
}} : {}),

...(props.withIconAutosize && props.variant === 'link' && props.size === 'sm' ? {
'& i': {
width: '16px',
height: '16px',
marginRight: '8px',
}} : {})
,
}),
Expand Down
1 change: 0 additions & 1 deletion src/components/Form/__snapshots__/Form.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ exports[`<Form /> should shallow form error 1`] = `
color="SECONDARY_TEXT_COLOR"
ellipsis={false}
kind="body"
weight="normal"
>
Some error
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Icon = ({ name, className, children, title, ...rest }: IconProps) => {
modifiers={ rest }
className={ className }
>
<Glyph width="100%" height="100%" />
<Glyph />
</IconSvgTag>
</When>
</Choose>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Icon/Icon.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const [IconWrapperTag, themeWrapper] = createThemeTag(`${name}Wrapper`, ({ COLOR


const [IconSvgTag, themeSvg] = createThemeTag(`${name}Svg`, {
root: {
'& > svg': {
height: '100%',
width: '100%',
},
},
modifiers: {
size: {
xs: {
Expand Down
4 changes: 0 additions & 4 deletions src/components/Icon/__snapshots__/Icon.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ exports[`<Icon /> should shallow input 1`] = `
title="Alert icon"
>
<Alert
height="100%"
viewBox="0 0 35 31"
width="100%"
>
<svg
height="100%"
viewBox="0 0 35 31"
width="100%"
>
<g
fill="none"
Expand Down
10 changes: 8 additions & 2 deletions src/components/Link/Link.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createThemeTag } from '../../theme/createThemeTag';
const name = 'link';

const [LinkTag, theme] = createThemeTag(name, ({ COLORS, FONTS }) => ({
root: {
root: props => ({
cursor: 'pointer',
...FONTS.LINK,
fontSize: 'inherit',
Expand All @@ -16,7 +16,13 @@ const [LinkTag, theme] = createThemeTag(name, ({ COLORS, FONTS }) => ({
'&:hover': {
textDecoration: 'underline',
},
},

...((props.color === 'BLUE_30' || props.color === 'BLUE' || props.color === 'PRIMARY') ? {
'&:active': {
color: COLORS.BLUE_10,
},
} : {}),
}),
modifiers: {
color: fp.mapValues(
(color) => ({ color }),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pagination/Pagination.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const [PaginationItemTag, themePaginationItem] = createThemeTag(`${name}Item`, (

'&:before': {
content: '\'\'',
backgroundColor: COLORS.BLUE_10,
backgroundColor: COLORS.PRIMARY,
borderRadius: 18,
position: 'absolute',
left: '- calc((28px - 100%) / 2)',
Expand Down
2 changes: 0 additions & 2 deletions src/components/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ function Text({
}

Text.defaultProps = {
color: 'PRIMARY_TEXT_COLOR',
weight: 'normal',
kind: 'body',
ellipsis: false,
};
Expand Down
2 changes: 1 addition & 1 deletion src/theme/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DEFINE_PALETTE = {
const PALETTE = {
...DEFINE_PALETTE,

PRIMARY: DEFINE_PALETTE.BLUE_10,
PRIMARY: DEFINE_PALETTE.BLUE_30,
SECONDARY: DEFINE_PALETTE.GREEN_40,
SUCCESS: DEFINE_PALETTE.GREEN_10,
DANGER: DEFINE_PALETTE.RED_30,
Expand Down

0 comments on commit 5d3101e

Please sign in to comment.