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

Commit dab34ea

Browse files
Andreas Broströmbstream
authored andcommitted
fix(Input): Fix styling when input has display inline-block
1 parent a77a03a commit dab34ea

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/input/input-default-styles.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ export default createStyleSheet('InputDefault', theme => {
1111
const bottomBorderSize = 3;
1212

1313
const modifierFn = color => ({
14+
marginBottom: inputMarginBottom,
15+
1416
'& .input__label': {
1517
color,
1618
},
1719

1820
'& .input__field': {
19-
marginBottom: 0,
2021
borderBottom: `${bottomBorderSize}px solid ${color}`,
2122
},
2223

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

2930
'&__field': {
30-
marginBottom: 0,
3131
borderBottom: `${bottomBorderSize}px solid ${disabledColor(color)}`,
3232
},
3333
},
@@ -41,7 +41,6 @@ export default createStyleSheet('InputDefault', theme => {
4141
},
4242

4343
'&__field': {
44-
marginBottom: 0,
4544
borderColor: color,
4645
borderBottom: `${bottomBorderSize}px solid ${color}`,
4746
},
@@ -54,7 +53,7 @@ export default createStyleSheet('InputDefault', theme => {
5453
fontSize: 14,
5554
fontFamily: typography.primary.fontFamily,
5655
color: palette.text.default,
57-
marginBottom: inputMarginBottom,
56+
marginBottom: inputMarginBottom + bottomBorderSize - borderSize,
5857
position: 'relative',
5958

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

7372
'&.input--has-focus': {
73+
marginBottom: inputMarginBottom,
7474
'& .input': {
7575
'&__label': {
7676
color: palette.action.active,
@@ -79,7 +79,6 @@ export default createStyleSheet('InputDefault', theme => {
7979
},
8080

8181
'&__field': {
82-
marginBottom: 0,
8382
borderColor: palette.action.active,
8483
borderBottom: `3px solid ${palette.action.active}`,
8584
},
@@ -145,7 +144,6 @@ export default createStyleSheet('InputDefault', theme => {
145144
padding: 8,
146145
paddingTop: 10,
147146
transition: transitions.create(['border-color']),
148-
marginBottom: inputMarginBottom + bottomBorderSize - borderSize,
149147
},
150148

151149
'& .input__label': {

0 commit comments

Comments
 (0)