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

Commit a45a1f9

Browse files
committed
feat(css-codegen-sheet.ts): Added isNumeric function Made conditional statements more robust
1 parent a635daa commit a45a1f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pseudo, camelToKebabCase, isClassesObjectType } from '..';
1+
import { pseudo, camelToKebabCase, isClassesObjectType, isNumeric } from '..';
22
import type { PropertyType, SerializeType, ClassesObjectType, CustomCSSProperties } from '../types';
33

44
export function cssCodeGenSheet(object: ClassesObjectType, base62Hash?: string, core?: string) {
@@ -41,8 +41,7 @@ export function cssCodeGenSheet(object: ClassesObjectType, base62Hash?: string,
4141
if (typeof value === 'string' || typeof value === 'number') {
4242
const CSSProp = camelToKebabCase(property);
4343
const applyValue = typeof value === 'number' ? value + 'px' : value;
44-
// If the media function contains a directly class selector Remove normal bug selector.
45-
property.length >= 2 ? (cssRule += `${bigIndent ? ' ' : ' '}${CSSProp}: ${applyValue};\n`) : '';
44+
if (!isNumeric(property) && property.length >= 2) cssRule += `${bigIndent ? ' ' : ' '}${CSSProp}: ${applyValue};\n`;
4645
} else if (isPseudoOrMediaClass) {
4746
if (isClassInc) colon = ':';
4847
if (isElementInc) colon = '::';

0 commit comments

Comments
 (0)