aurelia / aurelia/templating

Combining attributes from usage and the template

Open
#344 18 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted question
Dominant language
TypeScript
Stars
113
Forks
101
PR merge metrics
No merged PRs in 30d

Description

We have a custom attribute that we've made for local css modules (using webpack's css-loader's `modules` option) which maps the class in the css definition to the local identifier that's generated. The custom attribute is used like so:

``` html

My Heading

```

This works great; it takes the values in css-class and gets the mapped identifier, and then we apply the class to it accordingly.

The problem is, we also want to be able to apply the attribute to the `` tag for the component's root level element. This works, but if we also apply a css-class attribute when the component is used, it is overridden instead of combined. For classes, the values are combined, and we'd like the same for our custom attribute. Is there a setting that I'm missing? I can't seem to find it when going through the source.

Thanks!

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the templating implementation for custom attributes on template and component elements, then compare it with the existing class-value merging behavior; done means the requested custom attribute values combine consistently or the supported setting is identified and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.