Skip to content

Commit 059fad5

Browse files
committed
fix(css): return undefined if there is no className
1 parent da560d5 commit 059fad5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-styles/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* @param {any} args list of objects, string, or arrays to reduce
44
*/
5-
export function css(...args: any): string {
5+
export function css(...args: any): string | undefined {
66
// Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
77
const classes = [] as string[];
88
const hasOwn = {}.hasOwnProperty;
@@ -26,5 +26,5 @@ export function css(...args: any): string {
2626
}
2727
});
2828

29-
return classes.join(' ');
29+
return classes.join(' ').trim() || undefined;
3030
}

0 commit comments

Comments
 (0)