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

Commit 825ccdd

Browse files
committed
feat(*): HTMLType to CustomHTMLType and Scoped Class to Style Class
1 parent 3d89004 commit 825ccdd

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

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, HTMLType } from '../types';
2+
import type { PropertyType, ClassesObjectType, CustomCSSProperties, CustomHTMLType } from '../types';
33

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

src/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { Scoped } from './scoped';
1+
export { Style } from './style';
22
export { media } from './media-query';

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 { HTMLType } from '../../_internal';
1+
import type { CustomHTMLType } 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: HTMLType): void {
5+
export function global(object: CustomHTMLType): void {
66
const { styleSheet } = cssCodeGenSheet(object, undefined, '--global');
77
if (typeof globalStyleSheetPromise === 'undefined') createGlobalStyleSheetPromise();
88
resolveGlobalStyleSheet([styleSheet, '--global']);

src/core/scoped.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/core/style.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { ClassesObjectType, ReturnStyleType, CustomHTMLType, CustomCSSProperties, ExactClassesObjectType } from '../_internal';
2+
import { create } from './method/create';
3+
import { set } from './method/set';
4+
import { global } from './method/global';
5+
import { root } from './method/root';
6+
7+
export class Style {
8+
static create<T extends ClassesObjectType>(object: ExactClassesObjectType<T> | ClassesObjectType): ReturnStyleType<T> {
9+
return create(object);
10+
}
11+
static set(object: CustomCSSProperties): string {
12+
return set(object);
13+
}
14+
static global(object: CustomHTMLType): void {
15+
return global(object);
16+
}
17+
static root(object: CustomCSSProperties): void {
18+
return root(object);
19+
}
20+
}

0 commit comments

Comments
 (0)