Skip to content

Feature Request: Color Token Deduplication and Aliasing #20

@james-bash

Description

@james-bash

Currently, the exporter generates a new Color constant for every color token, even when multiple tokens share the same color value. This leads to duplicate Color instances in the generated Dart code.

Suggestion:
Introduce a deduplication mechanism so that if two or more color tokens have the same value, subsequent tokens are declared as aliases to the first constant. For example:
static const Color colorNeutralBlack1000 = Color(0xff040404);
and then:
static const Color backgroundAlwaysBlack = colorNeutralBlack1000;

I believe it can be done in the tailwind exporter, possible to do it for flutter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions