Skip to content

[Autofixer Request] LLM use variables in styles #70

@paoloricciuti

Description

@paoloricciuti

Describe the problematic code

A behaviour I've seen very often is that LLM tries to use variables in the style portion of the component. For the moment, the error is a cryptic "invalid CSS identifier". We should add a suggestion when we detect this compile error that steer the LLM towards using CSS variables.

Describe what the autofixer should suggest

You have an invalid CSS identifier in your code. This is often because you are trying to use JavaScript variables in CSS. This is not possible in Svelte, but you can use the variable to add an inline CSS variable on the style attribute of the element and then accessing the variable with var(--name) in CSS.

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    autofixerBug or Feature request related to a new autofixerenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions