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

Commit 6a85019

Browse files
committed
fix: mediaQuery bugfix
1 parent a6dd74f commit 6a85019

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/_internal/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ export type CustomExtendProperties = {
164164
firstLine?: CustomCSSProperties;
165165
marker?: CustomCSSProperties;
166166
selection?: CustomCSSProperties;
167-
[key: CSSVariableKey]: string;
168167
};
169168

170169
type GenericsArguments<T extends string, K extends string | number> = `${T}_${K}`;
@@ -173,11 +172,13 @@ type Nth = 'nthChild' | 'nthLastChild' | 'nthLastOftType' | 'nthOfType';
173172
type CSSVariableKey = `--${string}-${string}`;
174173
type CSSVariableValue = `var(${CSSVariableKey})`;
175174
type CSSColorValue = CSSColorNames | CSSVariableValue;
175+
type CSSVariableProperties = { [key: CSSVariableKey]: string };
176176

177177
export type CustomCSSProperties =
178-
| CustomExtendProperties & {
178+
| (CustomExtendProperties & {
179179
[K in keyof React.CSSProperties]: React.CSSProperties[K] | CSSVariableValue;
180-
};
180+
})
181+
| CSSVariableProperties;
181182

182183
export type ClassesObjectType = {
183184
[className: string]: CustomCSSProperties;

src/core/media-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import type { CustomCSSProperties, ClassesObjectType } from '../_internal';
33
export const media = (query: string, secondary?: string) => {
44
return (target: CustomCSSProperties | ClassesObjectType): ClassesObjectType => {
55
const mediaQuery = `@media (${query}${secondary ? ' and ' + secondary : ''})`;
6-
return { [mediaQuery]: target } as ClassesObjectType;
6+
return { [mediaQuery]: target };
77
};
88
};

0 commit comments

Comments
 (0)