Skip to content

Commit 7bd53ae

Browse files
author
Ian Wensink
committed
feat(styled-components): fix inline label
1 parent 1366cac commit 7bd53ae

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/WebformElement/styled/label.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export default styled.label`
88
vertical-align: top;
99
line-height: ${p => p.theme.inputHeight};
1010
11-
@media (min-width: 768px) {
12-
float: left;
13-
width: ${p => p.theme.inlineLabelWidth};
14-
padding-right: calc(${p => p.theme.spacingUnit} / 2);
15-
}
11+
${p => p.labelDisplay === 'inline' && `
12+
@media (min-width: 768px) {
13+
float: left;
14+
width: ${p.theme.inlineLabelWidth};
15+
padding-right: calc(${p.theme.spacingUnit} / 2);
16+
}
17+
`}
1618
1719
${p => p.labelDisplay === 'invisible' && `
1820
display: none;

0 commit comments

Comments
 (0)