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

Commit b641525

Browse files
committed
fix(types*): Removed unnecessary types ArgsPseudos and AndStrings because CustomCSSProperty was sufficient
1 parent 3f3a1f4 commit b641525

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

src/_internal/types/common/pseudo-selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export type ArgsPseudos =
8484
| LanguagesType
8585
| CustomNthArgsType;
8686

87-
export type AndStrings = `&${string}`;
87+
type AndStrings = `&${string}`;
8888
export type AndStringsType = {
8989
[key in AndStrings]: CustomCSSProperties;
9090
};
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import type { ArgsPseudos, AndStrings } from '../common/pseudo-selectors';
21
import type { CustomCSSProperties } from './custom-css-properties';
32

43
type JSXType = keyof JSX.IntrinsicElements | '*';
54

6-
type HTMLType = {
5+
export type HTMLType = {
76
[K in JSXType]?: CustomCSSProperties;
87
};
9-
10-
export type CustomHTMLType = HTMLType | ArgsPseudos | AndStrings;

src/_internal/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export * from './common/nth-selectors';
66
export * from './common/pseudo-selectors';
77
export * from './custom/classes-object-type';
88
export * from './custom/custom-css-properties';
9-
export * from './custom/custom-html-type';
9+
export * from './custom/html-type';
1010
export * from './custom/exact-classes-object-type';
1111
export * from './custom/property-type';
1212
export * from './custom/return-style-type';

src/_internal/utils/css-codegen-sheet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { pseudo, camelToKebabCase, isClassesObjectType } from '..';
2-
import type { PropertyType, ClassesObjectType, CustomCSSProperties, CustomHTMLType } from '../types';
2+
import type { PropertyType, ClassesObjectType, CustomCSSProperties, HTMLType } from '../types';
33

4-
export function cssCodeGenSheet(object: ClassesObjectType | CustomHTMLType, base62Hash?: string, core?: string) {
4+
export function cssCodeGenSheet(object: ClassesObjectType | HTMLType, base62Hash?: string, core?: string) {
55
let styleSheet = '';
66
let bigIndent = false;
77
const mediaQueries: Record<string, string> = {};

src/core/method/global.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { CustomHTMLType } from '../../_internal';
1+
import type { HTMLType } from '../../_internal';
22
import { isInDevelopment, injectCSSGlobal, cssCodeGenSheet } from '../../_internal';
33
import { resolveGlobalStyleSheet, globalStyleSheetPromise, createGlobalStyleSheetPromise } from './global-build-in-helper';
44

5-
export function global(object: CustomHTMLType): void {
5+
export function global(object: HTMLType): void {
66
const { styleSheet } = cssCodeGenSheet(object, undefined, '--global');
77
if (typeof globalStyleSheetPromise === 'undefined') createGlobalStyleSheetPromise();
88
resolveGlobalStyleSheet([styleSheet, '--global']);

src/core/scoped.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ClassesObjectType, ReturnStyleType, CustomHTMLType, CustomCSSProperties, ExactClassesObjectType } from '../_internal';
1+
import type { ClassesObjectType, ReturnStyleType, HTMLType, CustomCSSProperties, ExactClassesObjectType } from '../_internal';
22
import { sheet } from './method/sheet';
33
import { style } from './method/style';
44
import { global } from './method/global';
@@ -11,7 +11,7 @@ export class Scoped {
1111
static style(object: CustomCSSProperties): string {
1212
return style(object);
1313
}
14-
static global(object: CustomHTMLType): void {
14+
static global(object: HTMLType): void {
1515
return global(object);
1616
}
1717
static root(object: CustomCSSProperties): void {

0 commit comments

Comments
 (0)