From da57101e7c56bc1160cf3a53b85a8257d340ff03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Bie=C5=84?= Date: Wed, 8 Apr 2020 21:13:38 +0200 Subject: [PATCH] fix(button,tab,textfield): make components inherit font-family --- src/components/Button/Button.js | 1 + src/components/Tab/Tab.js | 2 +- src/components/TextField/TextField.js | 4 ++-- src/components/common/system.js | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Button/Button.js b/src/components/Button/Button.js index 07860ff7..3583f32f 100644 --- a/src/components/Button/Button.js +++ b/src/components/Button/Button.js @@ -43,6 +43,7 @@ const commonButtonStyles = css` &:not(:disabled) { cursor: pointer; } + font-family: inherit; `; export const StyledButton = styled.button` diff --git a/src/components/Tab/Tab.js b/src/components/Tab/Tab.js index 91c50b94..3588a088 100644 --- a/src/components/Tab/Tab.js +++ b/src/components/Tab/Tab.js @@ -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: ''; @@ -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; diff --git a/src/components/TextField/TextField.js b/src/components/TextField/TextField.js index 6d048b5e..d7a292e7 100644 --- a/src/components/TextField/TextField.js +++ b/src/components/TextField/TextField.js @@ -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` @@ -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()} diff --git a/src/components/common/system.js b/src/components/common/system.js index c1030a5c..6f2e81c5 100644 --- a/src/components/common/system.js +++ b/src/components/common/system.js @@ -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';