typicode / mistcss

Create React visual components without JavaScript or TypeScript. Leverage native HTML and CSS. It's an alternative to CSS-in-JS and CSS modules.
MIT License
859 stars 25 forks source link

fix: fix rendered code when user defined props are not passed #13

Closed godnondsilva closed 7 months ago

godnondsilva commented 7 months ago

Problem Description

If the user does not pass any custom props, then the generated code will have an extra comma (,) Example:

Button.mist.css

@scope (.button) {
button:scope {
/* Default style */
font-size: 1rem;
border-radius: 0.25rem;
}
}

Button.mist.tsx

export function Button ({ className, , ...props }: Props) {

Video Explanation

IMAGE ALT TEXT HERE Timestamp: 3:32 - 3:52 Credits: Josh tried coding

typicode commented 7 months ago

Thank you!