Repository navigation
Conversation
Contributor
|
Preview is ready. |
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.
What
Regular icon components now take their stroke width from the
--g-icon-stroke-widthCSS variable:1.5, the width icons are drawn with, so without the variable icons look as before.1up works, on an icon or any ancestor. Since it is CSS, it passes through uikit'sIcon(which doesn't forward props to the icon component), covers uikit's own icons, and can change at runtime.-fillicons, accent paths (the red dot in*-doticons) and files insvgs/are unchanged and ignore the variable.How it works: icons are 1.5px strokes with round joins, outlined in Figma.
npm run src:iconsshrinks the outline of each regular icon to a 1px stroke (Skia path ops viapathkit-wasm, a new dev dependency, seescripts/stroke-width.mjs) and adds acurrentColorstroke on top whose width isvariable − 1. Shrinking an outline by half of the width difference equals re-stroking its centerline, so the stroke grows it back to the requested width: by 0.25 per side at1.5(the original look), by 0.5 at2.Seven icons lose details at 1px (
card-club,flame,logo-docker,logo-rustore,logo-yandex-messenger,paper-plane,pin-slash). They keep their 1.5px outline and only get bolder.A new Icons / Weights story shows icons at 1, 1.5 and 2px side by side, and the whole set at 1–2px.
Why
A design proposal to switch icon stroke width between 1px, 1.5px (default) and 2px without redrawing icons by hand.
Notes for review
eye-slash, is 0.13 px² at 16px.person,calculator,circle-letter-g), see the story. A new icon that breaks at 1px has to be added to the list inscripts/stroke-width.mjs.(width − 1.5) / 2.strokeattributes, so consumers recoloring icons with CSSfillinstead ofcolorwould get a stroke of another color. Should this be released as a breaking change?CircleLetterDandCopyCheckXmark; whichever PR is merged second needsnpm run src:iconsagain.