connorjs / css-typed

TypeScript declaration generator for CSS files
https://npmjs.com/package/css-typed
MIT License
4 stars 1 forks source link

Gracefully handle invalid class names #2

Closed connorjs closed 1 month ago

connorjs commented 8 months ago

Overview

As a user, I want css-typed to generate TS-compliant variable names for otherwise-invalid CSS class names. For example, kebab-case.

Notes

connorjs commented 8 months ago

See https://github.com/connorjs/css-typed/pull/1 for the first approach to this.

connorjs commented 8 months ago

[Research note]

Vite has support for kebab-case to camelCase.

A quick scan of Qwik suggests "defaults" but also "thanks to Vite."

My gut thought is to (a) default to no kebab-case to camelCase transformation but (b) only emit valid TS.

Note: I will create a "1.0 roadmap" tracking issue and include this in there (later).

connorjs commented 7 months ago

Another note: stylelint-config-standard recommends kebab-case. Therefore, I’m strongly inclined to default to handling kebab-case. I’ll open a PR to change that this week.

connorjs commented 1 month ago

This will be solved with upcoming localsConvention option. The next release will default to dashesOnly which will handle kebab-case by default.