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' ;
53
64export const shadow = '4px 4px 10px 0 rgba(0, 0, 0, 0.35)' ;
75export const insetShadow = 'inset 2px 2px 3px rgba(0,0,0,0.2)' ;
@@ -47,13 +45,13 @@ export const createHatchedBackground = ({
4745 background-position : 0 0 , ${ `${ pixelSize } px ${ pixelSize } px` } ;
4846` ;
4947
50- export const createFlatBoxStyles = ( ) => css `
48+ export const createFlatBoxStyles = ( ) => css < CommonThemeProps > `
5149 position: relative;
5250 box-sizing: border-box;
5351 display: inline-block;
5452 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 } ;
5755 border: 2px solid ${ ( { theme } ) => theme . canvas } ;
5856 outline: 2px solid ${ ( { theme } ) => theme . flatDark } ;
5957 outline-offset: -4px;
@@ -64,18 +62,18 @@ export const createBorderStyles = ({
6462 windowBorders = false
6563} = { } ) =>
6664 invert
67- ? css `
65+ ? css < CommonThemeProps > `
6866 border-style: solid;
6967 border-width: 2px;
7068 border-left-color: ${ ( { theme } ) => theme . borderDarkest } ;
7169 border-top-color: ${ ( { theme } ) => theme . borderDarkest } ;
7270 border-right-color: ${ ( { theme } ) => theme . borderLightest } ;
7371 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 } ,
7674 inset -1px -1px 0 1px ${ ( { theme } ) => theme . borderLight } ;
7775 `
78- : css `
76+ : css < CommonThemeProps > `
7977 border-style: solid;
8078 border-width: 2px;
8179 border-left-color: ${ ( { theme } ) =>
@@ -84,8 +82,8 @@ export const createBorderStyles = ({
8482 windowBorders ? theme . borderLight : theme . borderLightest } ;
8583 border-right-color: ${ ( { theme } ) => theme . borderDarkest } ;
8684 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
8987 ${ ( { theme } ) =>
9088 windowBorders ? theme . borderLightest : theme . borderLight } ,
9189 inset -1px -1px 0 1px ${ ( { theme } ) => theme . borderDark } ;
0 commit comments