Skip to content

Remove false props before generating styles #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 6, 2020

Conversation

andreruffert
Copy link
Owner

@andreruffert andreruffert commented Jun 26, 2020

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: styled-components#102

Prevents generating `undefined` style properties e.g

`{ fontSize: '16px', fontFamily: undefined }`

The above props would generate the following styles:

```
font-size: 16px;
font-family: undefined;
```

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

```
font-size: 16px;
```

More details: styled-components#102
@andreruffert andreruffert merged commit 7fe4b7f into master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant