Repository navigation
SVG: read var() with the CSS custom properties or the fallback - #2200
Open
RavSinghChandan wants to merge 2 commits into
Open
RavSinghChandan wants to merge 2 commits into
RavSinghChandan wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Figma writes colors as
fill="var(--fill-0, #171D25)"when they are variables, and VS Code extensions writefill="var(--vscode-foreground, #808080)"in their walkthrough images, as in the Python and Jupyter extensions. Both fail withValueError: unsupported color specification var(...).A
var()in a style or a presentation attribute now takes the value of the custom property, declared in a<style>or astyleattribute on the element or an ancestor, or else its fallback, as in browsers. Without either, or with custom properties that reference each other in a cycle, the property is inherited, as CSS makes it invalid at computed-value time. The substitution is bounded, so properties that double at each step stop being substituted.test_svg_css_var,test_svg_css_var_opacity_and_transformandtest_svg_css_var_substitutions_are_boundedcover these; they fail without the change.