zss-engine 0.2.49 → 0.2.50
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.
|
@@ -27,8 +27,8 @@ const createKeyframes = (property, content) => {
|
|
|
27
27
|
function transpile(object, base36Hash, core) {
|
|
28
28
|
let styleSheet = '';
|
|
29
29
|
const mediaQueries = [];
|
|
30
|
-
const
|
|
31
|
-
return core === '--global' ? property : `.${
|
|
30
|
+
const classNameApply = (property) => {
|
|
31
|
+
return core === '--global' ? property : `.${base36Hash}`;
|
|
32
32
|
};
|
|
33
33
|
const rules = (indent, rulesValue, property) => {
|
|
34
34
|
if (typeof property !== 'string')
|
|
@@ -108,7 +108,7 @@ function transpile(object, base36Hash, core) {
|
|
|
108
108
|
const keyframesContent = object[property];
|
|
109
109
|
styleSheet += createKeyframes(property, keyframesContent);
|
|
110
110
|
}
|
|
111
|
-
const classSelectors = stringConverter(
|
|
111
|
+
const classSelectors = stringConverter(classNameApply(property), object[property], 1);
|
|
112
112
|
for (const selector in classSelectors) {
|
|
113
113
|
if (!selector.startsWith('@keyframes') && classSelectors[selector]) {
|
|
114
114
|
styleSheet += selector + ' {\n' + classSelectors[selector] + '}\n';
|
|
@@ -24,8 +24,8 @@ const createKeyframes = (property, content) => {
|
|
|
24
24
|
export function transpile(object, base36Hash, core) {
|
|
25
25
|
let styleSheet = '';
|
|
26
26
|
const mediaQueries = [];
|
|
27
|
-
const
|
|
28
|
-
return core === '--global' ? property : `.${
|
|
27
|
+
const classNameApply = (property) => {
|
|
28
|
+
return core === '--global' ? property : `.${base36Hash}`;
|
|
29
29
|
};
|
|
30
30
|
const rules = (indent, rulesValue, property) => {
|
|
31
31
|
if (typeof property !== 'string')
|
|
@@ -105,7 +105,7 @@ export function transpile(object, base36Hash, core) {
|
|
|
105
105
|
const keyframesContent = object[property];
|
|
106
106
|
styleSheet += createKeyframes(property, keyframesContent);
|
|
107
107
|
}
|
|
108
|
-
const classSelectors = stringConverter(
|
|
108
|
+
const classSelectors = stringConverter(classNameApply(property), object[property], 1);
|
|
109
109
|
for (const selector in classSelectors) {
|
|
110
110
|
if (!selector.startsWith('@keyframes') && classSelectors[selector]) {
|
|
111
111
|
styleSheet += selector + ' {\n' + classSelectors[selector] + '}\n';
|
package/package.json
CHANGED
package/types/utils/hash.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateStyle, CreateKeyframes } from '../index.js';
|
|
2
|
-
export declare function genBase36Hash(object: CreateStyle | CreateKeyframes, n: number): string;
|
|
1
|
+
import { CreateStyle, CreateKeyframes, CSSProperties } from '../index.js';
|
|
2
|
+
export declare function genBase36Hash(object: CreateStyle | CSSProperties | CreateKeyframes, n: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSHTML } from '../index.js';
|
|
2
|
-
export declare function transpile(object: CSSHTML, base36Hash?: string, core?: string): {
|
|
1
|
+
import type { CSSProperties, CSSHTML, CreateStyle } from '../index.js';
|
|
2
|
+
export declare function transpile(object: CSSHTML | CreateStyle | CSSProperties, base36Hash?: string, core?: string): {
|
|
3
3
|
styleSheet: string;
|
|
4
4
|
};
|