Skip to content
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

Fix types #1318

Merged
merged 2 commits into from
Jun 3, 2020
Merged

Fix types #1318

merged 2 commits into from
Jun 3, 2020

Conversation

sorteam
Copy link
Contributor

@sorteam sorteam commented Mar 19, 2020

Corresponding issue (if exists):

  • perfomance issue in VSCode because of deep nesting type JssStyle = JssStyleP<
    JssStyleP<JssStyleP<JssStyleP<JssStyleP<JssStyleP<JssStyleP>>>>>
  • wrong types for css values

What would you like to add/fix?

  • use recursive types (TS 3.7+)
  • allow using arrays in css values

Using recursive type
Allow using padding: [[0, '5px']]
@sorteam sorteam requested a review from HenriBeck as a code owner March 19, 2020 10:44
@sorteam
Copy link
Contributor Author

sorteam commented Mar 19, 2020

Example of usecase:

import { Styles, WithStylesProps } from 'react-jss';

const styles = (theme: any): Styles => ({
    autocomplete: {
        backgroundColor: theme.whiteBackgroundColor,
        boxShadow: theme.shadow1,
        outline: 'none',
        display: 'flex',
        flexDirection: 'column',
        flex: '1 1 auto',
        padding: [['1rem', 0]],
        overflow: 'auto',
    },
});

interface Props extends WithStylesProps<ReturnType<typeof styles>> { ... }

@kof kof merged commit ddec3e5 into cssinjs:master Jun 3, 2020
@kof
Copy link
Member

kof commented Jun 3, 2020

Released in v10.2.0

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.

None yet

2 participants