diplodoc-platform / diplodoc-platform/transform
HTML elements style override
- Dominant language
- TypeScript
- Stars
- 69
- Forks
- 59
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 6
Description
### What is the problem this feature will solve?
YFM has some "global" styles that change styles for everything inside, for example
https://github.com/diplodoc-platform/transform/blob/39885ba2586c519f4db461143a5c0bf5ffca814f/src/scss/_common.scss#L33
+ all global elements styles changes
This styles is clearly was added for text elements to have some default styling, but this is also makes creating custom YFM widgets harder, because you need to override a bunch of opinionated global style to have proper look for your widget that happens to have table (in our case we displaying code snippet, that use table for aligning line numbers and code)
### What is the feature you are proposing to solve the problem?
I propose to use class names for YFM default elements and target only this classes in styles. Or may be have some "cancelling" styles, like `.yfm h1:not(.yfm-custom-widget)`, so widget authors could use it to avoid global styles
### What alternatives have you considered?
_No response_
#519
Contributor guide
Research direction
Start by reviewing src/scss/_common.scss at the linked lines to identify the global element styles affecting custom YFM widgets. Determine a focused styling approach from the issue’s proposed alternatives, and consider the work done when default YFM text styling remains while widget content such as tables is not unintentionally overridden.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scss
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100