Repository navigation
Read a light-dark() color as its light color - #546
Merged
Merged
Conversation
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.
A
light-dark()color is not read, so the shape loses its fill or stroke and svglib logs "Can't handle color". draw.io writeslight-dark()in its SVG exports, usually in astylethat overrides a plain color attribute, for examplestroke="#63de17" style="stroke: light-dark(rgb(99, 222, 23), rgb(237, 237, 237))"in the icons of the Zensical theme used by Python-Markdown's documentation (.zensical/theme/assets/images/pyMd_icon.svg): the icon's outline disappears.In CSS Color 5,
light-dark()uses its first color unless acolor-schemeasks for dark, and SVG documents rarely set one, soconvertColor()now converts the first argument. A new_first_css_argument()finds it, skipping the commas insidergb(...)orhsl(...). With this change the outline of that icon is green, as in a browser.Added
test_light_dark_color(rgb, a different case, hsl, a single argument, andcurrentColor); it fails on main. Updatedtests/public_api.jsonwith--updatefor the new private name, and added a### Fixedentry inCHANGELOG.md(I used #547, I'll fix it if the PR gets another number).pytest(without the network-dependent sample downloads),ruff format --check,ruff checkandmypy src testspass.AI-assisted (Claude Code); I reviewed and tested the change