Skip to content

Support dynamic values in local-class #36

@dfreeman

Description

@dfreeman

Currently the preprocessor will reject non-static local-class values, e.g.

{{my-component local-class=(some-kind-of subExpression)}}

There's no technical reason we can't handle this case, but it does raise a couple of interesting questions. The simplest translation of the above would look something like:

{{my-component class=(get styles (some-kind-of subExpression))}}

However, this wouldn't handle cases like this (contrived) example where multiple class names are produced:

{{my-component local-class=(concat 'foo bar')}}

For these cases, we'll probably need to introduce a helper to split the string and look up the appropriate classes, so the compiled version might look something like:

{{my-component class=(lookup-module-styles (unbound styles) (some-kind-of subExpression))}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions