Skip to content

Commit

Permalink
fix(button,tab,textfield): make components inherit font-family
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbien committed Apr 8, 2020
1 parent 956f0c6 commit da57101
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const commonButtonStyles = css`
&:not(:disabled) {
cursor: pointer;
}
font-family: inherit;
`;

export const StyledButton = styled.button`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const StyledTab = styled.button`
cursor: default;
color: ${({ theme }) => theme.text};
user-select: none;
font-family: inherit;
&:focus:after,
&:active:after {
content: '';
Expand Down Expand Up @@ -57,7 +58,6 @@ const StyledTab = styled.button`
}
`;

// TODO handle tabIndex
const Tab = React.forwardRef(function Tab(props, ref) {
const { value, onClick, selected, children, ...otherProps } = props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import propTypes from 'prop-types';

import styled, { css } from 'styled-components';
import { createDisabledTextStyles, createFlatBoxStyles } from '../common';
import { blockSizes, fontFamily } from '../common/system';
import { blockSizes } from '../common/system';
import Cutout from '../Cutout/Cutout';

const sharedWrapperStyles = css`
Expand Down Expand Up @@ -39,7 +39,7 @@ const sharedInputStyles = css`
background: none;
font-size: 1rem;
min-height: 27px;
font-family: ${fontFamily};
font-family: inherit;
color: ${({ theme }) => theme.inputText};
${({ disabled, variant }) =>
variant !== 'flat' && disabled && createDisabledTextStyles()}
Expand Down
3 changes: 1 addition & 2 deletions src/components/common/system.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// TODO - implement styled-system

// eslint-disable-next-line import/prefer-default-export
export const blockSizes = {
sm: '27px',
md: '35px',
lg: '43px'
};

export const fontFamily = 'sans-serif';

0 comments on commit da57101

Please sign in to comment.