zss-engine 2.2.7 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +6 -9
- package/dist/cjs/utils/helper.js +9 -6
- package/dist/cjs/utils/processor-atomic.js +9 -7
- package/dist/cjs/utils/transpile-atomic.js +1 -1
- package/dist/cjs/utils/transpile.js +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/utils/helper.js +7 -5
- package/dist/esm/utils/processor-atomic.js +5 -3
- package/dist/esm/utils/transpile-atomic.js +2 -2
- package/dist/esm/utils/transpile.js +2 -2
- package/dist/types/index.d.ts +2 -5
- package/dist/types/types/css-properties.d.ts +23 -0
- package/dist/types/utils/helper.d.ts +1 -3
- package/dist/types/utils/override-longhand.d.ts +1 -1
- package/dist/types/utils/transpile.d.ts +2 -2
- package/package.json +1 -1
- package/dist/cjs/types/main/global.js +0 -2
- package/dist/cjs/types/main/variableTypes.js +0 -2
- package/dist/cjs/types/main/viewTransition.js +0 -2
- package/dist/esm/types/main/global.js +0 -1
- package/dist/esm/types/main/variableTypes.js +0 -1
- package/dist/esm/types/main/viewTransition.js +0 -1
- package/dist/types/types/common/css-properties.d.ts +0 -46
- package/dist/types/types/main/global.d.ts +0 -37
- package/dist/types/types/main/variableTypes.d.ts +0 -7
- package/dist/types/types/main/viewTransition.d.ts +0 -7
- /package/dist/cjs/types/{common/css-properties.js → css-properties.js} +0 -0
- /package/dist/cjs/types/{common/css-property.js → css-property.js} +0 -0
- /package/dist/esm/types/{common/css-properties.js → css-properties.js} +0 -0
- /package/dist/esm/types/{common/css-property.js → css-property.js} +0 -0
- /package/dist/types/types/{common/css-property.d.ts → css-property.d.ts} +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exceptionCamelCase = exports.applyCssValue = exports.camelToKebabCase = exports.overrideLonghand = exports.processAtomicProps = exports.splitAtomicAndNested = exports.transpileAtomic = exports.transpile = exports.genBase36Hash =
|
|
4
|
-
var helper_js_1 = require("./utils/helper.js");
|
|
5
|
-
Object.defineProperty(exports, "isServer", { enumerable: true, get: function () { return helper_js_1.isServer; } });
|
|
6
|
-
Object.defineProperty(exports, "isDevelopment", { enumerable: true, get: function () { return helper_js_1.isDevelopment; } });
|
|
7
|
-
Object.defineProperty(exports, "isTestingDevelopment", { enumerable: true, get: function () { return helper_js_1.isTestingDevelopment; } });
|
|
3
|
+
exports.exceptionCamelCase = exports.isAtRule = exports.applyCssValue = exports.camelToKebabCase = exports.overrideLonghand = exports.processAtomicProps = exports.splitAtomicAndNested = exports.transpileAtomic = exports.transpile = exports.genBase36Hash = void 0;
|
|
8
4
|
var hash_js_1 = require("./utils/hash.js");
|
|
9
5
|
Object.defineProperty(exports, "genBase36Hash", { enumerable: true, get: function () { return hash_js_1.genBase36Hash; } });
|
|
10
6
|
var transpile_js_1 = require("./utils/transpile.js");
|
|
@@ -16,7 +12,8 @@ Object.defineProperty(exports, "splitAtomicAndNested", { enumerable: true, get:
|
|
|
16
12
|
Object.defineProperty(exports, "processAtomicProps", { enumerable: true, get: function () { return processor_atomic_js_1.processAtomicProps; } });
|
|
17
13
|
var override_longhand_js_1 = require("./utils/override-longhand.js");
|
|
18
14
|
Object.defineProperty(exports, "overrideLonghand", { enumerable: true, get: function () { return override_longhand_js_1.overrideLonghand; } });
|
|
19
|
-
var
|
|
20
|
-
Object.defineProperty(exports, "camelToKebabCase", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "applyCssValue", { enumerable: true, get: function () { return
|
|
22
|
-
Object.defineProperty(exports, "
|
|
15
|
+
var helper_js_1 = require("./utils/helper.js");
|
|
16
|
+
Object.defineProperty(exports, "camelToKebabCase", { enumerable: true, get: function () { return helper_js_1.camelToKebabCase; } });
|
|
17
|
+
Object.defineProperty(exports, "applyCssValue", { enumerable: true, get: function () { return helper_js_1.applyCssValue; } });
|
|
18
|
+
Object.defineProperty(exports, "isAtRule", { enumerable: true, get: function () { return helper_js_1.isAtRule; } });
|
|
19
|
+
Object.defineProperty(exports, "exceptionCamelCase", { enumerable: true, get: function () { return helper_js_1.exceptionCamelCase; } });
|
package/dist/cjs/utils/helper.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isAtRule = exports.camelToKebabCase = exports.applyCssValue = exports.exceptionCamelCase = void 0;
|
|
4
4
|
const hex_to_color_name_js_1 = require("./hex-to-color-name.js");
|
|
5
|
-
const isWindowDefined = typeof window !== 'undefined';
|
|
6
|
-
const isDocumentDefined = typeof document !== 'undefined';
|
|
7
|
-
exports.isServer = !isWindowDefined || !isDocumentDefined;
|
|
8
|
-
exports.isDevelopment = process.env.NODE_ENV === 'development';
|
|
9
|
-
exports.isTestingDevelopment = process.env.NODE_ENV === 'test' || exports.isDevelopment;
|
|
10
5
|
const exception = [
|
|
11
6
|
'animation-iteration-count',
|
|
12
7
|
'aspect-ratio',
|
|
@@ -66,3 +61,11 @@ const camelToKebabCase = (property) => {
|
|
|
66
61
|
.toLowerCase());
|
|
67
62
|
};
|
|
68
63
|
exports.camelToKebabCase = camelToKebabCase;
|
|
64
|
+
const isAtRule = (prop) => {
|
|
65
|
+
return (prop.startsWith('@media') ||
|
|
66
|
+
prop.startsWith('@container') ||
|
|
67
|
+
prop.startsWith('@supports') ||
|
|
68
|
+
prop.startsWith('@layer') ||
|
|
69
|
+
prop.startsWith('@scope'));
|
|
70
|
+
};
|
|
71
|
+
exports.isAtRule = isAtRule;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.splitAtomicAndNested = splitAtomicAndNested;
|
|
4
4
|
exports.processAtomicProps = processAtomicProps;
|
|
5
|
-
const
|
|
5
|
+
const helper_js_1 = require("./helper.js");
|
|
6
|
+
const transpile_atomic_js_1 = require("./transpile-atomic.js");
|
|
7
|
+
const hash_js_1 = require("./hash.js");
|
|
6
8
|
const shorthand_js_1 = require("./shorthand.js");
|
|
7
9
|
function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
8
10
|
const queryFlat = flat;
|
|
@@ -11,7 +13,7 @@ function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
|
11
13
|
if (property.startsWith(':') || property.startsWith('[')) {
|
|
12
14
|
queryNonFlat[property] = value;
|
|
13
15
|
}
|
|
14
|
-
else if (
|
|
16
|
+
else if ((0, helper_js_1.isAtRule)(property)) {
|
|
15
17
|
const innerFlat = {};
|
|
16
18
|
const innerNonFlat = {};
|
|
17
19
|
splitAtomicAndNested(value, innerFlat, innerNonFlat);
|
|
@@ -34,21 +36,21 @@ Object.entries(shorthand_js_1.SHORTHAND_PROPERTIES).forEach(([shorthand, longhan
|
|
|
34
36
|
function processAtomicProps(flatProps, atomicMap, parentAtRule) {
|
|
35
37
|
const resultQueue = [];
|
|
36
38
|
for (const [key, style] of Object.entries(flatProps)) {
|
|
37
|
-
if (
|
|
39
|
+
if ((0, helper_js_1.isAtRule)(key)) {
|
|
38
40
|
processAtomicProps(style, atomicMap, key);
|
|
39
41
|
continue;
|
|
40
42
|
}
|
|
41
43
|
resultQueue.push([key, style]);
|
|
42
44
|
}
|
|
43
45
|
for (const [property, value] of resultQueue) {
|
|
44
|
-
const CSSProp = (0,
|
|
45
|
-
const normalizedValue = (0,
|
|
46
|
+
const CSSProp = (0, helper_js_1.camelToKebabCase)(property);
|
|
47
|
+
const normalizedValue = (0, helper_js_1.applyCssValue)(value, CSSProp);
|
|
46
48
|
const singlePropObj = { [property]: normalizedValue };
|
|
47
49
|
const styleObj = parentAtRule ? { [parentAtRule]: singlePropObj } : singlePropObj;
|
|
48
|
-
const atomicHash = (0,
|
|
50
|
+
const atomicHash = (0, hash_js_1.genBase36Hash)(styleObj, 1, 8);
|
|
49
51
|
if (atomicMap.has(atomicHash))
|
|
50
52
|
continue;
|
|
51
|
-
let styleSheet = (0,
|
|
53
|
+
let styleSheet = (0, transpile_atomic_js_1.transpileAtomic)(property, value, atomicHash);
|
|
52
54
|
if (parentAtRule) {
|
|
53
55
|
styleSheet = `${parentAtRule} { ${styleSheet} }`;
|
|
54
56
|
}
|
|
@@ -16,7 +16,7 @@ function transpileAtomic(property, value, hash, pseudo) {
|
|
|
16
16
|
selector += pseudo;
|
|
17
17
|
}
|
|
18
18
|
const atomicRule = `${selector} { ${CSSProp}: ${applyValue}; }`;
|
|
19
|
-
if (
|
|
19
|
+
if ((0, helper_js_1.isAtRule)(property)) {
|
|
20
20
|
return `${property} { ${atomicRule} }`;
|
|
21
21
|
}
|
|
22
22
|
return atomicRule;
|
|
@@ -54,7 +54,7 @@ function transpile(object, base36Hash, core) {
|
|
|
54
54
|
const styles = stringConverter(selector, value, indentLevel);
|
|
55
55
|
Object.assign(classSelector, styles);
|
|
56
56
|
}
|
|
57
|
-
else if (
|
|
57
|
+
else if ((0, helper_js_1.isAtRule)(property)) {
|
|
58
58
|
const mediaRule = property;
|
|
59
59
|
let nestedRules = '';
|
|
60
60
|
let regularRules = '';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { isServer, isDevelopment, isTestingDevelopment } from './utils/helper.js';
|
|
2
1
|
export { genBase36Hash } from './utils/hash.js';
|
|
3
2
|
export { transpile } from './utils/transpile.js';
|
|
4
3
|
export { transpileAtomic } from './utils/transpile-atomic.js';
|
|
5
4
|
export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
|
|
6
5
|
export { overrideLonghand } from './utils/override-longhand.js';
|
|
7
|
-
export { camelToKebabCase, applyCssValue, exceptionCamelCase } from './utils/helper.js';
|
|
6
|
+
export { camelToKebabCase, applyCssValue, isAtRule, exceptionCamelCase } from './utils/helper.js';
|
package/dist/esm/utils/helper.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { hexToColorName } from './hex-to-color-name.js';
|
|
2
|
-
const isWindowDefined = typeof window !== 'undefined';
|
|
3
|
-
const isDocumentDefined = typeof document !== 'undefined';
|
|
4
|
-
export const isServer = !isWindowDefined || !isDocumentDefined;
|
|
5
|
-
export const isDevelopment = process.env.NODE_ENV === 'development';
|
|
6
|
-
export const isTestingDevelopment = process.env.NODE_ENV === 'test' || isDevelopment;
|
|
7
2
|
const exception = [
|
|
8
3
|
'animation-iteration-count',
|
|
9
4
|
'aspect-ratio',
|
|
@@ -61,3 +56,10 @@ export const camelToKebabCase = (property) => {
|
|
|
61
56
|
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
|
|
62
57
|
.toLowerCase());
|
|
63
58
|
};
|
|
59
|
+
export const isAtRule = (prop) => {
|
|
60
|
+
return (prop.startsWith('@media') ||
|
|
61
|
+
prop.startsWith('@container') ||
|
|
62
|
+
prop.startsWith('@supports') ||
|
|
63
|
+
prop.startsWith('@layer') ||
|
|
64
|
+
prop.startsWith('@scope'));
|
|
65
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { camelToKebabCase,
|
|
1
|
+
import { camelToKebabCase, applyCssValue, isAtRule } from './helper.js';
|
|
2
|
+
import { transpileAtomic } from './transpile-atomic.js';
|
|
3
|
+
import { genBase36Hash } from './hash.js';
|
|
2
4
|
import { SHORTHAND_PROPERTIES } from './shorthand.js';
|
|
3
5
|
function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
4
6
|
const queryFlat = flat;
|
|
@@ -7,7 +9,7 @@ function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
|
7
9
|
if (property.startsWith(':') || property.startsWith('[')) {
|
|
8
10
|
queryNonFlat[property] = value;
|
|
9
11
|
}
|
|
10
|
-
else if (
|
|
12
|
+
else if (isAtRule(property)) {
|
|
11
13
|
const innerFlat = {};
|
|
12
14
|
const innerNonFlat = {};
|
|
13
15
|
splitAtomicAndNested(value, innerFlat, innerNonFlat);
|
|
@@ -30,7 +32,7 @@ Object.entries(SHORTHAND_PROPERTIES).forEach(([shorthand, longhands]) => {
|
|
|
30
32
|
function processAtomicProps(flatProps, atomicMap, parentAtRule) {
|
|
31
33
|
const resultQueue = [];
|
|
32
34
|
for (const [key, style] of Object.entries(flatProps)) {
|
|
33
|
-
if (
|
|
35
|
+
if (isAtRule(key)) {
|
|
34
36
|
processAtomicProps(style, atomicMap, key);
|
|
35
37
|
continue;
|
|
36
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyCssValue, camelToKebabCase } from './helper.js';
|
|
1
|
+
import { applyCssValue, camelToKebabCase, isAtRule } from './helper.js';
|
|
2
2
|
import { SHORTHAND_PROPERTIES } from './shorthand.js';
|
|
3
3
|
const ALL_LONGHANDS = new Set(Object.values(SHORTHAND_PROPERTIES).flat());
|
|
4
4
|
function transpileAtomic(property, value, hash, pseudo) {
|
|
@@ -13,7 +13,7 @@ function transpileAtomic(property, value, hash, pseudo) {
|
|
|
13
13
|
selector += pseudo;
|
|
14
14
|
}
|
|
15
15
|
const atomicRule = `${selector} { ${CSSProp}: ${applyValue}; }`;
|
|
16
|
-
if (
|
|
16
|
+
if (isAtRule(property)) {
|
|
17
17
|
return `${property} { ${atomicRule} }`;
|
|
18
18
|
}
|
|
19
19
|
return atomicRule;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { camelToKebabCase, applyCssValue } from './helper.js';
|
|
1
|
+
import { camelToKebabCase, applyCssValue, isAtRule } from './helper.js';
|
|
2
2
|
const createKeyframes = (property, content) => {
|
|
3
3
|
let keyframesRules = `${property} {\n`;
|
|
4
4
|
for (const key in content) {
|
|
@@ -51,7 +51,7 @@ export function transpile(object, base36Hash, core) {
|
|
|
51
51
|
const styles = stringConverter(selector, value, indentLevel);
|
|
52
52
|
Object.assign(classSelector, styles);
|
|
53
53
|
}
|
|
54
|
-
else if (
|
|
54
|
+
else if (isAtRule(property)) {
|
|
55
55
|
const mediaRule = property;
|
|
56
56
|
let nestedRules = '';
|
|
57
57
|
let regularRules = '';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export type { CSSProperties } from './types/
|
|
2
|
-
export type { CreateTheme } from './types/main/variableTypes';
|
|
3
|
-
export type { ViewTransition } from './types/main/viewTransition';
|
|
4
|
-
export { isServer, isDevelopment, isTestingDevelopment } from './utils/helper.js';
|
|
1
|
+
export type { CSSProperties } from './types/css-properties.js';
|
|
5
2
|
export { genBase36Hash } from './utils/hash.js';
|
|
6
3
|
export { transpile } from './utils/transpile.js';
|
|
7
4
|
export { transpileAtomic } from './utils/transpile-atomic.js';
|
|
8
5
|
export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
|
|
9
6
|
export { overrideLonghand } from './utils/override-longhand.js';
|
|
10
|
-
export { camelToKebabCase, applyCssValue, exceptionCamelCase } from './utils/helper.js';
|
|
7
|
+
export { camelToKebabCase, applyCssValue, isAtRule, exceptionCamelCase } from './utils/helper.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Properties } from 'csstype';
|
|
2
|
+
type CSSVariableKey = `--${string}`;
|
|
3
|
+
type CSSVariableValue = `var(${CSSVariableKey})`;
|
|
4
|
+
type CSSVariableProperty = {
|
|
5
|
+
[key: CSSVariableKey]: string | number;
|
|
6
|
+
};
|
|
7
|
+
type BaseCSSProperties = {
|
|
8
|
+
[K in keyof Properties]: Properties[K] | CSSVariableValue;
|
|
9
|
+
};
|
|
10
|
+
type ArrayString = `[${string}`;
|
|
11
|
+
type ArraySelector = {
|
|
12
|
+
[key in ArrayString]: BaseCSSProperties | CSSVariableProperty;
|
|
13
|
+
};
|
|
14
|
+
type ColonString = `:${string}`;
|
|
15
|
+
type ColonSelector = {
|
|
16
|
+
[key in ColonString]: BaseCSSProperties | CSSVariableProperty;
|
|
17
|
+
};
|
|
18
|
+
type Query = `@media ${string}` | `@container ${string}`;
|
|
19
|
+
type QuerySelector = {
|
|
20
|
+
[K in Query]: BaseCSSProperties | ColonSelector | ArraySelector | CSSVariableProperty;
|
|
21
|
+
};
|
|
22
|
+
export type CSSProperties = BaseCSSProperties | ArraySelector | ColonSelector | QuerySelector | CSSVariableProperty;
|
|
23
|
+
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export declare const isServer: boolean;
|
|
2
|
-
export declare const isDevelopment: boolean;
|
|
3
|
-
export declare const isTestingDevelopment: boolean;
|
|
4
1
|
export declare const exceptionCamelCase: string[];
|
|
5
2
|
export declare const applyCssValue: (value: string | number, cssProp: string) => string;
|
|
6
3
|
export declare const camelToKebabCase: (property: string) => string;
|
|
4
|
+
export declare const isAtRule: (prop: string) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSSProperties } from '../types/
|
|
1
|
+
import type { CSSProperties } from '../types/css-properties.js';
|
|
2
2
|
export declare const overrideLonghand: (style: CSSProperties) => CSSProperties;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function transpile(object:
|
|
1
|
+
import type { CSSProperties } from '../types/css-properties.js';
|
|
2
|
+
export declare function transpile(object: Record<string, CSSProperties>, base36Hash?: string, core?: string): {
|
|
3
3
|
styleSheet: string;
|
|
4
4
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { CSSVariableValue, CSSVariableProperty } from '../main/variableTypes';
|
|
2
|
-
import type { Properties, Property } from 'csstype';
|
|
3
|
-
type ColorValue = Exclude<Property.Color, '-moz-initial'> | (string & {});
|
|
4
|
-
type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
|
|
5
|
-
type SystemColorKeyword = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonFace' | 'ButtonHighlight' | 'ButtonShadow' | 'ButtonText' | 'CaptionText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
|
|
6
|
-
type ExcludeMozInitial<T> = Exclude<T, '-moz-initial'>;
|
|
7
|
-
type CSSTypeProperties = Properties<number | (string & {})>;
|
|
8
|
-
type CustomProperties = {
|
|
9
|
-
[K in keyof CSSTypeProperties]: ExcludeMozInitial<CSSTypeProperties[K]>;
|
|
10
|
-
};
|
|
11
|
-
type BaseCSSProperties = {
|
|
12
|
-
[K in keyof CustomProperties]: CustomProperties[K] | CSSVariableValue;
|
|
13
|
-
};
|
|
14
|
-
interface CommonProperties extends BaseCSSProperties {
|
|
15
|
-
accentColor?: CSSColorProperty;
|
|
16
|
-
color?: CSSColorProperty;
|
|
17
|
-
borderLeftColor?: CSSColorProperty;
|
|
18
|
-
borderRightColor?: CSSColorProperty;
|
|
19
|
-
borderTopColor?: CSSColorProperty;
|
|
20
|
-
borderBottomColor?: CSSColorProperty;
|
|
21
|
-
borderBlockColor?: CSSColorProperty;
|
|
22
|
-
borderBlockStartColor?: CSSColorProperty;
|
|
23
|
-
borderBlockEndColor?: CSSColorProperty;
|
|
24
|
-
borderInlineColor?: CSSColorProperty;
|
|
25
|
-
borderInlineStartColor?: CSSColorProperty;
|
|
26
|
-
borderInlineEndColor?: CSSColorProperty;
|
|
27
|
-
backgroundColor?: CSSColorProperty;
|
|
28
|
-
outlineColor?: CSSColorProperty;
|
|
29
|
-
textDecorationColor?: CSSColorProperty;
|
|
30
|
-
caretColor?: CSSColorProperty;
|
|
31
|
-
columnRuleColor?: CSSColorProperty;
|
|
32
|
-
}
|
|
33
|
-
type ArrayString = `[${string}`;
|
|
34
|
-
type ArraySelector = {
|
|
35
|
-
[key in ArrayString]: CommonProperties | CSSVariableProperty;
|
|
36
|
-
};
|
|
37
|
-
type ColonString = `:${string}`;
|
|
38
|
-
type ColonSelector = {
|
|
39
|
-
[key in ColonString]: CommonProperties | CSSVariableProperty;
|
|
40
|
-
};
|
|
41
|
-
export type Query = `@media ${string}` | `@container ${string}`;
|
|
42
|
-
type QuerySelector = {
|
|
43
|
-
[K in Query]: CommonProperties | ColonSelector | ArraySelector | CSSVariableProperty;
|
|
44
|
-
};
|
|
45
|
-
export type CSSProperties = CommonProperties | ArraySelector | ColonSelector | QuerySelector | CSSVariableProperty;
|
|
46
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, Query } from '../common/css-properties';
|
|
2
|
-
type JSXType = keyof HTMLElementTagNameMap | '*' | ':root';
|
|
3
|
-
type HTMLSelector = {
|
|
4
|
-
[K in JSXType]: CSSProperties;
|
|
5
|
-
};
|
|
6
|
-
type ClassName = `.${string}`;
|
|
7
|
-
type ClassNameSelector = {
|
|
8
|
-
[K in ClassName]: CSSProperties;
|
|
9
|
-
};
|
|
10
|
-
type Attribute = `${string}[${string}]${string}`;
|
|
11
|
-
type AttributeSelector = {
|
|
12
|
-
[K in Attribute]: CSSProperties;
|
|
13
|
-
};
|
|
14
|
-
type Consecutive = `${JSXType} ${string}`;
|
|
15
|
-
type ConsecutiveSelector = {
|
|
16
|
-
[K in Consecutive]: CSSProperties;
|
|
17
|
-
};
|
|
18
|
-
type PseudoClass = `${JSXType}:${string}`;
|
|
19
|
-
type PseudoClassSelector = {
|
|
20
|
-
[K in PseudoClass]: CSSProperties;
|
|
21
|
-
};
|
|
22
|
-
type PseudoElement = `::${string}`;
|
|
23
|
-
type PseudoElementSelector = {
|
|
24
|
-
[K in PseudoElement]: CSSProperties;
|
|
25
|
-
};
|
|
26
|
-
type KeyframesInSelector = 'from' | 'to' | `${number}%`;
|
|
27
|
-
export type Keyframes = {
|
|
28
|
-
[K in KeyframesInSelector]?: CSSProperties;
|
|
29
|
-
};
|
|
30
|
-
type KeyframesSelector = {
|
|
31
|
-
[K in `@keyframes ${string}`]: Keyframes;
|
|
32
|
-
};
|
|
33
|
-
type QuerySelectorHTML = {
|
|
34
|
-
[K in Query]: CSSHTML;
|
|
35
|
-
};
|
|
36
|
-
export type CSSHTML = HTMLSelector | ClassNameSelector | AttributeSelector | ConsecutiveSelector | PseudoClassSelector | PseudoElementSelector | KeyframesSelector | QuerySelectorHTML;
|
|
37
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
type CSSVariableKey = `--${string}`;
|
|
2
|
-
export type CSSVariableValue = `var(${CSSVariableKey})`;
|
|
3
|
-
export type CSSVariableProperty = {
|
|
4
|
-
[key: CSSVariableKey]: string | number;
|
|
5
|
-
};
|
|
6
|
-
export type CreateTheme = Record<string, Record<string, string | number>>;
|
|
7
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|