Neon icon indicating copy to clipboard operation
Neon copied to clipboard

Have highlighting/selection coloring use CSS

Open JRegimbal opened this issue 6 years ago • 2 comments

Rather than manually setting and unsetting fill colors for the SVG elements when applying different highlights or marking elements as selected, it would be best to create entries in src/style.css that will handle coloring based on the classes of the elements. Since we already apply the highlighted class to highlighted elements and selected class to selected musical elements, this should require little refactoring in JavaScript.

This would reduce the risk of bugs appearing in highlighting by removing the responsibility of coloring logic from the user.

JRegimbal avatar Jun 19 '19 18:06 JRegimbal

Actually implementing this in CSS would require support for CSS 4 selectors (specifically of <selector> for :nth-child) and this is currently not widely supported. See this page for browser support of this feature.

JRegimbal avatar Jun 19 '19 18:06 JRegimbal

@yinanazhou we're also unsure about this one, please help?

JoyfulGen avatar May 27 '22 14:05 JoyfulGen