Merge classes when several class attributes given
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 179
- Forks
- 63
- Avg merge
- 5h
- Merged PRs (30d)
- 22
Description
I think it would be interesting to be able to put several class attributes.
let popup ?(a = []) content =
let box = D.div ~a:(a_class ["popup"]::a) content in
...
Here my function creates a widget popup.
All popups have class "popup".
But I'd like to make possible for user to customize the widget by adding any attribute he wants.
With the current version of tyxml, the code below does not work if a contains a class ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the D.div call and a_class usage shown in the issue to see how the supplied attribute list handles multiple class attributes. Done means a widget can provide a default "popup" class while accepting additional user attributes, including another class, without the current failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100