cobalt-ui icon indicating copy to clipboard operation
cobalt-ui copied to clipboard

Feature: Add @property definitions to CSS plugin output

Open davejsdev opened this issue 2 years ago • 3 comments

@property definitions help enable type safety for CSS Custom Properties.

MDN Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/@property

It might be good to make a flag for this in the plugin too since defining property types is optional and adds extra weight to the output.

Suggested API:

// Types
interface Options {
  // ...
  propertyDefinitions?: boolean;  // default: true
}

// Usage
pluginCSS({
  propertyDefinitions: false
})

davejsdev avatar Dec 10 '23 15:12 davejsdev

Hey! Would love to work on this!

deecodess avatar Feb 04 '24 07:02 deecodess

@deecodess Sure! I’d be happy to have some help! But before you start, I’d love to see a proposal (maybe just as a reply to this issue) for what each DTCG token type would translate to in a @property declaration. That way we are on the same page!

drwpow avatar Feb 06 '24 15:02 drwpow