Skip to content
Snippets Groups Projects
Commit daa2e388 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(textfield): override the textfield

parent 10645a20
No related branches found
No related tags found
1 merge request!43Sprint #19
import { css } from 'styled-components'
import { th, validationColor } from '@pubsweet/ui-toolkit'
const textColor = ({ theme, validationStatus = 'default' }) =>
({
error: theme.colorError,
success: theme.colorText,
default: theme.colorText,
warning: theme.colorWarning,
}[validationStatus])
export default {
Input: css`
border: ${th('borderWidth')} ${th('borderStyle')} ${validationColor};
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBase')};
line-height: ${th('lineHeightBase')};
color: ${textColor};
&:active,
&:focus {
border-color: ${th('textField.activeBorder')};
outline: none;
}
&::placeholder {
font-family: "'Myriad Pro Italic'";
font-size: ${th('fontSizeBase')};
line-height: ${th('lineHeightBase')};
}
&[disabled] {
opacity: 0.4;
&:active,
&:focus {
border-color: ${th('colorBorder')};
}
}
`,
Label: css`
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBase')};
line-height: ${th('lineHeightBase')};
`,
}
import Button from './Button' import Button from './Button'
import TextField from './TextField'
export { Button } export { Button, TextField }
File added
File added
@font-face { @font-face {
font-family: 'Myriad Pro'; font-family: 'Myriad Pro';
font-style: normal;
font-weight: normal;
src: url('./MYRIADPRO-REGULAR.woff') format('woff'); src: url('./MYRIADPRO-REGULAR.woff') format('woff');
} }
@font-face { @font-face {
font-family: 'Myriad Pro Semi'; font-family: 'Myriad Pro Semi';
font-style: normal;
font-weight: normal;
src: url('./MYRIADPRO-SEMIBOLD.woff') format('woff'); src: url('./MYRIADPRO-SEMIBOLD.woff') format('woff');
} }
@font-face { @font-face {
font-family: 'Myriad Pro Bold'; font-family: 'Myriad Pro Bold';
font-style: normal;
font-weight: normal;
src: url('./MYRIADPRO-BOLD.woff') format('woff'); src: url('./MYRIADPRO-BOLD.woff') format('woff');
} }
@font-face {
font-family: 'Myriad Pro Italic';
font-style: normal;
font-weight: normal;
src: url('./MYRIADPRO-CONDIT.woff') format('woff');
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { injectGlobal } from 'styled-components' import { injectGlobal } from 'styled-components'
import './fonts/index.css' import './fonts/index.css'
import { Button } from './elements' import { Button, TextField } from './elements'
injectGlobal` injectGlobal`
body { body {
...@@ -20,11 +20,11 @@ const hindawiTheme = { ...@@ -20,11 +20,11 @@ const hindawiTheme = {
colorPrimary: '#63A945', colorPrimary: '#63A945',
colorSecondary: '#586971', colorSecondary: '#586971',
colorFurniture: '#DBDBDB', colorFurniture: '#DBDBDB',
colorBorder: '#AAA', colorBorder: '#DBDBDB',
colorBackgroundHue: '#F1F1F1', colorBackgroundHue: '#F1F1F1',
colorSuccess: '#63A945', colorSuccess: '#63A945',
colorError: '#DBAFC1', colorError: '#FC6A4B',
colorText: '#363636', colorText: '#242424',
colorTextReverse: '#667080', colorTextReverse: '#667080',
colorTextPlaceholder: '#595959', colorTextPlaceholder: '#595959',
colorWarning: '#FC6A4B', colorWarning: '#FC6A4B',
...@@ -59,6 +59,10 @@ const hindawiTheme = { ...@@ -59,6 +59,10 @@ const hindawiTheme = {
smallMinWidth: '80px', smallMinWidth: '80px',
}, },
textField: {
activeBorder: '#003049',
},
/* Text variables */ /* Text variables */
// fonts // fonts
fontInterface: "'Myriad Pro Bold'", fontInterface: "'Myriad Pro Bold'",
...@@ -107,6 +111,7 @@ const hindawiTheme = { ...@@ -107,6 +111,7 @@ const hindawiTheme = {
cssOverrides: { cssOverrides: {
ui: { ui: {
Button, Button,
TextField,
}, },
}, },
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment