styled-components / vue-styled-components

Visual primitives for the component age. A simple port for Vue of styled-components 💅
MIT License
1.39k stars 99 forks source link

Remove false props before generating styles #113

Closed andreruffert closed 3 years ago

andreruffert commented 4 years ago

This PR adds a filter to remove false props to prevent generating undefined style properties.

Example props { fontSize: '16px', fontFamily: undefined }

The above props would generate the following styles:

.iRGQtx {
  font-size: 16px;
  font-family: undefined;
}

The new feature here is filtering false props before generating and injecting the styles. The new styles now look like this:

.iRGQtx {
  font-size: 16px;
}

Related: https://github.com/styled-components/vue-styled-components/pull/102

andreruffert commented 4 years ago

@liqueflies any opinion on that?

fatlinesofcode commented 4 years ago

can this be merged in the next release?

liqueflies commented 3 years ago

Solved merging #111