Allow nested span with inherited styles
- Dominant language
- Rust
- Stars
- 38
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
It's not possible to have nested spans that inherit the parent's styles. One migth expect this however:
- [ ] `span!(bg="red", [span!(fg="white", ["Error"]),]);` shows the word "Error" as white text on red background.
What do you think? Is this a good idea or not?
- - -
This is because of this reset call:
https://github.com/killercup/output-rs/blob/abbe3f145954358457bf542af207784324e39290/src/components/span.rs#L110
It might make sense to call this here instead/additionally:
https://github.com/killercup/output-rs/blob/abbe3f145954358457bf542af207784324e39290/src/lib.rs#L75-L78
Contributor guide
Research direction
Read src/components/span.rs around line 110 and src/lib.rs around lines 75-78 to understand where reset behavior is applied. Verify the nested span example with a red parent and white child, and consider the change complete when the child text renders white while retaining the red background.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100