[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.config, DiscussionPage.config, DiscussionListItem, and the classList utility. Trace how each component applies and removes body or root classes, then add the specified tag-based classes and verify that classes are removed on unload and reflect the active or discussion tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100