vaadin / copilot

1 stars 0 forks source link

Copying from Figma to Flow should utilize LumoUtility classes instead of String-based CSS classes #23

Closed vesanieminen closed 2 months ago

vesanieminen commented 5 months ago

Is your feature request related to a problem?

Currently Copilot generates code like this:

        HorizontalLayout horizontallayout2 = new HorizontalLayout();
        horizontallayout2.setClassName("justify-between items-end");
        HorizontalLayout horizontallayout3 = new HorizontalLayout();
        horizontallayout3.setClassName("justify-center items-end");

The classnames are set as strings but ideally they should rely on LumoUtility Java members instead.

Describe the solution you'd like

The output should look something like this:

        HorizontalLayout horizontallayout2 = new HorizontalLayout();
        horizontallayout2.addClassNames(
                LumoUtility.JustifyContent.BETWEEN,
                LumoUtility.AlignItems.END
        );
        HorizontalLayout horizontallayout3 = new HorizontalLayout();
        horizontallayout3.addClassNames(
                LumoUtility.JustifyContent.CENTER,
                LumoUtility.AlignItems.END
        );