[Tags] Apply a className to various elements based on the active tags
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
_From @tobscure on August 27, 2015 13:50_
We should add a className to the body and each DiscussionListItem based on what tags are in use. Could be handy for doing some special tag-based styling.
What needs to be done:
- Extend IndexPage's `config` method to add a class (`IndexPage--tag--{slug}`) to the body based on the currently-active tag. Ensure that it is removed properly onunload.
- Extend DiscussionPage's `config` method to add classes (`DiscussionPage--tag--{slug}`) to the body based on the current discussion's tags. Ensure that they are removed properly onunload.
- Extract core's DiscussionListItem classes into a method that returns an object of class names, which is then applied to the root element using the classList util.
- Extend that new classNames method and add classes (`DiscussionListItem--tag--{slug}`) based on the discussion's tags.
_Copied from original issue: flarum/tags#15_
Contributor guide
Research direction
Locate IndexPage and DiscussionPage config methods, DiscussionListItem's existing classes, and the classList utility. Verify how active and discussion tags are represented, then confirm that body and item classes reflect those tags and are removed on unload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100