Styled-components: styles wrongly composed when border-style is used

Created on 31 May 2017  路  3Comments  路  Source: styled-components/styled-components

When I am using border-style: solid in combination with some other border properties the result that styled-components is returning me is not working

const Input = styled.input`
  width: 100%;

  border-style: solid
  border-top-width: ${props => (props.underline ? '0' : '2px')};
  border-bottom-width: 2px;
`

is returning this:

width: 100%;
border-style: solid border-top-width: 0;  <---BAD
border-bottom-width: 2px;

Version

2.0.0-10

Reproduction

https://www.webpackbin.com/bins/-KlTAoiCcv59O0CuMANn

Most helpful comment

The next patch version is going to use stylis 3 which adds missing semicolons :)

All 3 comments

You forgot a semicolon.

const Input = styled.input`
  width: 100%;

  border-style: solid;
  border-top-width: ${props => (props.underline ? '0' : '2px')};
  border-bottom-width: 2px;
`

god! thanks! :weary:

with the old version I didn't realize it.

The next patch version is going to use stylis 3 which adds missing semicolons :)

Was this page helpful?
0 / 5 - 0 ratings