feat: Make zoom controls and trash can native SVG #9128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change-Id: Ied0a26ebfff7a02183a00ddd7d2ed08c4346f65b
The basics
The details
Resolves
Fixes #4821
Proposed Changes
This change inlines the SVG from sprites.svg into the trashcan and zoom control classes, allowing for them to be styled with CSS.
Reason for Changes
Currently, the controls are rendered as PNGs, which makes creating high contrast versions in both regular theme and dark mode both
Test Coverage
Documentation
It may be worth noting in the documentation that product builds on Blockly can override the colors using the
.blocklyZoom
and.blocklyTrash
classes.Additional Information
Note that to make the controls interactive in Firefox I had to create a non-zero fill opacity, otherwise the mouse events are only captured by the control outlines. We may also want to consider building the SVG based on the other constants rather than the hard coded values taken from sprites.svg.