Skip to content

Fix types#1318

Merged
kof merged 2 commits intocssinjs:masterfrom
sorteam:master
Jun 3, 2020
Merged

Fix types#1318
kof merged 2 commits intocssinjs:masterfrom
sorteam:master

Conversation

@sorteam
Copy link
Copy Markdown
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

sorteam added 2 commits March 19, 2020 13:35
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
Copy Markdown
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
Copy Markdown
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.

2 participants