1
- import { css , ThemedStyledProps } from 'styled-components' ;
2
- import { Color , CommonThemeProps , Theme } from '../types' ;
3
-
4
- type CSSProps = ThemedStyledProps < CommonThemeProps , Theme > ;
1
+ import { css } from 'styled-components' ;
2
+ import { Color , CommonThemeProps } from '../types' ;
5
3
6
4
export const shadow = '4px 4px 10px 0 rgba(0, 0, 0, 0.35)' ;
7
5
export const insetShadow = 'inset 2px 2px 3px rgba(0,0,0,0.2)' ;
@@ -47,13 +45,13 @@ export const createHatchedBackground = ({
47
45
background-position : 0 0 , ${ `${ pixelSize } px ${ pixelSize } px` } ;
48
46
` ;
49
47
50
- export const createFlatBoxStyles = ( ) => css `
48
+ export const createFlatBoxStyles = ( ) => css < CommonThemeProps > `
51
49
position: relative;
52
50
box-sizing: border-box;
53
51
display: inline-block;
54
52
color: ${ ( { theme } ) => theme . materialText } ;
55
- background : ${ ( { theme , isDisabled } : CSSProps ) =>
56
- isDisabled ? theme . flatLight : theme . canvas } ;
53
+ background: ${ ( { $disabled , theme } ) =>
54
+ $disabled ? theme . flatLight : theme . canvas } ;
57
55
border: 2px solid ${ ( { theme } ) => theme . canvas } ;
58
56
outline: 2px solid ${ ( { theme } ) => theme . flatDark } ;
59
57
outline-offset: -4px;
@@ -64,18 +62,18 @@ export const createBorderStyles = ({
64
62
windowBorders = false
65
63
} = { } ) =>
66
64
invert
67
- ? css `
65
+ ? css < CommonThemeProps > `
68
66
border-style: solid;
69
67
border-width: 2px;
70
68
border-left-color: ${ ( { theme } ) => theme . borderDarkest } ;
71
69
border-top-color: ${ ( { theme } ) => theme . borderDarkest } ;
72
70
border-right-color: ${ ( { theme } ) => theme . borderLightest } ;
73
71
border-bottom-color: ${ ( { theme } ) => theme . borderLightest } ;
74
- box-shadow : ${ ( props : CSSProps ) => props . shadow && `${ shadow } , ` } inset
75
- 1px 1 px 0 px 1 px ${ ( { theme } ) => theme . borderDark } ,
72
+ box-shadow: ${ props => props . shadow && `${ shadow } , ` } inset 1px 1px 0px
73
+ 1px ${ ( { theme } ) => theme . borderDark } ,
76
74
inset -1px -1px 0 1px ${ ( { theme } ) => theme . borderLight } ;
77
75
`
78
- : css `
76
+ : css < CommonThemeProps > `
79
77
border-style: solid;
80
78
border-width: 2px;
81
79
border-left-color: ${ ( { theme } ) =>
@@ -84,8 +82,8 @@ export const createBorderStyles = ({
84
82
windowBorders ? theme . borderLight : theme . borderLightest } ;
85
83
border-right-color: ${ ( { theme } ) => theme . borderDarkest } ;
86
84
border-bottom-color: ${ ( { theme } ) => theme . borderDarkest } ;
87
- box-shadow : ${ ( props : CSSProps ) => props . shadow && `${ shadow } , ` } inset
88
- 1px 1 px 0 px 1 px
85
+ box-shadow: ${ props => props . shadow && `${ shadow } , ` } inset 1px 1px 0px
86
+ 1px
89
87
${ ( { theme } ) =>
90
88
windowBorders ? theme . borderLightest : theme . borderLight } ,
91
89
inset -1px -1px 0 1px ${ ( { theme } ) => theme . borderDark } ;
0 commit comments