Skip to content

Commit

Permalink
Simplify CSSProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jan 20, 2020
1 parent d345232 commit 78f5ec8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/material-ui-styles/src/withStyles/withStyles.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export type StyleRules<Props extends object = {}, ClassKey extends string = stri
ClassKey,
// JSS property bag
| CSSProperties
// JSS property bag based on a theme
| (() => CSSProperties)
// JSS property bag where values are based on props
| CreateCSSProperties<Props>
// JSS property bag based on props
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui-styles/test/styles.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,14 @@ function forwardRefTest() {
// If there are no props, use the definition that doesn't accept them
// https://github.com/mui-org/material-ui/issues/16198

// $ExpectType Record<"root", CSSProperties | (() => CSSProperties) | CreateCSSProperties<{}> | ((props: {}) => CreateCSSProperties<{}>)>
// $ExpectType Record<"root", CSSProperties | CreateCSSProperties<{}> | ((props: {}) => CreateCSSProperties<{}>)>
const styles = createStyles({
root: {
width: 1,
},
});

// $ExpectType Record<"root", CSSProperties | (() => CSSProperties) | CreateCSSProperties<{}> | ((props: {}) => CreateCSSProperties<{}>)>
// $ExpectType Record<"root", CSSProperties | CreateCSSProperties<{}> | ((props: {}) => CreateCSSProperties<{}>)>
const styles2 = createStyles({
root: () => ({
width: 1,
Expand All @@ -473,7 +473,7 @@ function forwardRefTest() {
foo: boolean;
}

// $ExpectType Record<"root", CSSProperties | (() => CSSProperties) | CreateCSSProperties<testProps> | ((props: testProps) => CreateCSSProperties<testProps>)>
// $ExpectType Record<"root", CSSProperties | CreateCSSProperties<testProps> | ((props: testProps) => CreateCSSProperties<testProps>)>
const styles3 = createStyles({
root: (props: testProps) => ({
width: 1,
Expand Down

0 comments on commit 78f5ec8

Please sign in to comment.