Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the way components are given their attributes #14

Open
filipdutescu opened this issue Apr 2, 2023 · 0 comments · May be fixed by #41
Open

Improve the way components are given their attributes #14

filipdutescu opened this issue Apr 2, 2023 · 0 comments · May be fixed by #41
Assignees
Labels
feature New feature or request
Milestone

Comments

@filipdutescu
Copy link
Owner

filipdutescu commented Apr 2, 2023

Description

Currently, each component needs to have its class, id and HTML event attributes manually set. This is firstly hard to maintain and secondly a pain to look at.

Proposal

Figure out a way to create an html! macro that does the same things as yew::html! but adds the aforementioned attributes to the HTML tag.

Other relevant information

Depends on yewstack/yew#1533 and/or yewstack/yew#2950

@filipdutescu filipdutescu added the feature New feature or request label Apr 2, 2023
@filipdutescu filipdutescu added this to the 0.4.0 milestone Apr 2, 2023
@filipdutescu filipdutescu self-assigned this Apr 2, 2023
@filipdutescu filipdutescu modified the milestones: 0.4.0, 1.0 Apr 11, 2023
@filipdutescu filipdutescu linked a pull request Apr 22, 2023 that will close this issue
10 tasks
@filipdutescu filipdutescu modified the milestones: 1.0, 0.5.0 Apr 22, 2023
filipdutescu added a commit that referenced this issue Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML
attributes that each component should expose. It takes a tag, children
and the base attributes. It also defines a new property, `attrs` which
contains the extra attributes that a component should have defined. This
includes non-standard ones, such as `data-*`.

Add some [ARIA attributes][aria] to the base properties. Modify the
`base_component_properties` to also implement `From<T>` for
`BaseComponentProperties`, in order to make it easy to pass the default
properties down to the `BaseComponent`. This is also implemented for a
reference to `T`.

This also updates all components and their examples.

[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes

Fixes: #14
Signed-off-by: Filip Dutescu <filip@hucksy.dev>
filipdutescu added a commit that referenced this issue Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML
attributes that each component should expose. It takes a tag, children
and the base attributes. It also defines a new property, `attrs` which
contains the extra attributes that a component should have defined. This
includes non-standard ones, such as `data-*`.

Add some [ARIA attributes][aria] to the base properties. Modify the
`base_component_properties` to also implement `From<T>` for
`BaseComponentProperties`, in order to make it easy to pass the default
properties down to the `BaseComponent`. This is also implemented for a
reference to `T`.

This also updates all components and their examples.

[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes

Fixes: #14
Signed-off-by: Filip Dutescu <filip@hucksy.dev>
filipdutescu added a commit that referenced this issue Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML
attributes that each component should expose. It takes a tag, children
and the base attributes. It also defines a new property, `attrs` which
contains the extra attributes that a component should have defined. This
includes non-standard ones, such as `data-*`.

Add some [ARIA attributes][aria] to the base properties. Modify the
`base_component_properties` to also implement `From<T>` for
`BaseComponentProperties`, in order to make it easy to pass the default
properties down to the `BaseComponent`. This is also implemented for a
reference to `T`.

This also updates all components and their examples.

[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes

Fixes: #14
Signed-off-by: Filip Dutescu <filip@hucksy.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant