Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
fix(Input): Fix styling when input has display inline-block
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Broström authored and bstream committed Jun 8, 2017
1 parent a77a03a commit dab34ea
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/input/input-default-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export default createStyleSheet('InputDefault', theme => {
const bottomBorderSize = 3;

const modifierFn = color => ({
marginBottom: inputMarginBottom,

'& .input__label': {
color,
},

'& .input__field': {
marginBottom: 0,
borderBottom: `${bottomBorderSize}px solid ${color}`,
},

Expand All @@ -27,7 +28,6 @@ export default createStyleSheet('InputDefault', theme => {
},

'&__field': {
marginBottom: 0,
borderBottom: `${bottomBorderSize}px solid ${disabledColor(color)}`,
},
},
Expand All @@ -41,7 +41,6 @@ export default createStyleSheet('InputDefault', theme => {
},

'&__field': {
marginBottom: 0,
borderColor: color,
borderBottom: `${bottomBorderSize}px solid ${color}`,
},
Expand All @@ -54,7 +53,7 @@ export default createStyleSheet('InputDefault', theme => {
fontSize: 14,
fontFamily: typography.primary.fontFamily,
color: palette.text.default,
marginBottom: inputMarginBottom,
marginBottom: inputMarginBottom + bottomBorderSize - borderSize,
position: 'relative',

'&.input--has-success': modifierFn(palette.variant.success),
Expand All @@ -71,6 +70,7 @@ export default createStyleSheet('InputDefault', theme => {
},

'&.input--has-focus': {
marginBottom: inputMarginBottom,
'& .input': {
'&__label': {
color: palette.action.active,
Expand All @@ -79,7 +79,6 @@ export default createStyleSheet('InputDefault', theme => {
},

'&__field': {
marginBottom: 0,
borderColor: palette.action.active,
borderBottom: `3px solid ${palette.action.active}`,
},
Expand Down Expand Up @@ -145,7 +144,6 @@ export default createStyleSheet('InputDefault', theme => {
padding: 8,
paddingTop: 10,
transition: transitions.create(['border-color']),
marginBottom: inputMarginBottom + bottomBorderSize - borderSize,
},

'& .input__label': {
Expand Down

0 comments on commit dab34ea

Please sign in to comment.