Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 3609227

Browse files
committed
fix(custom-css-properties): Stop using cross type and use extends at interface
1 parent 7d7514f commit 3609227

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/_internal/types/custom/custom-css-properties.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import { MediaQuery, MediaQueryType } from './custom-html-type';
1414
import { HtmlTags } from '../../utils/html-tags';
1515
import { LanguageCodes } from '../../utils/language-codes';
1616

17-
type CustomExtendProperties = {
17+
type BaseCSSProperties = {
18+
[K in keyof React.CSSProperties]: React.CSSProperties[K] | CSSVariableValue;
19+
};
20+
21+
interface CustomExtendProperties extends BaseCSSProperties {
1822
width?: CSSNumericValue | CSSLengthSubValue | 'auto';
1923
height?: CSSNumericValue | CSSLengthSubValue | 'auto';
2024
margin?: CSSEdgeSizeValue;
@@ -53,7 +57,7 @@ type CustomExtendProperties = {
5357
color?: CSSColorValue | CSSGlobalValue;
5458
background?: CSSColorValue | CSSGlobalValue | 'none';
5559
backgroundColor?: CSSColorValue | CSSGlobalValue;
56-
};
60+
}
5761

5862
type PseudoElementsAndClassKeys =
5963
| 'active'
@@ -96,15 +100,7 @@ type PseudoElementsAndClassType = {
96100
[K in PseudoElementsAndClassKeys]?: CustomCSSProperties;
97101
};
98102

99-
export type CustomCSSProperties =
100-
| ArgsPseudos
101-
| AndStringsType
102-
| (CustomExtendProperties & {
103-
[K in keyof React.CSSProperties]: React.CSSProperties[K] | CSSVariableValue;
104-
})
105-
| CSSVariableProperties
106-
| MediaQueryType
107-
| PseudoElementsAndClassType;
103+
export type CustomCSSProperties = CustomExtendProperties | AndStringsType | ArgsPseudos | CSSVariableProperties | MediaQueryType | PseudoElementsAndClassType;
108104

109105
export type ExtendedCSSProperties =
110106
| CustomCSSProperties

0 commit comments

Comments
 (0)