Repository navigation
💭 Dream window: gradient-style — import keeps px stripes, radial at-positions, multi-layer + Repeat off restores stops - #134
Merged
Conversation
… from swallowing stops A hand-written repeating-linear-gradient(45deg, #000 0 10px, #fff 10px 20px) imported as a plain 0-100% ramp: length/angle positions were dropped, so the tile vanished. Repeating gradients now keep them (normal gradients still auto-distribute, per the existing test). The prelude scan tested whole segments as colors, so 'red 0%' never matched and every stop fell into the prelude: radial size became the first stop's position (0% circle -> invalid CSS, blank preview) and conic 'at 30% 40%' picked up a trailing comma. Length hints print without a stray %. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applyParsedToStores set the named position to 'center', which wins over x/y in the output, and kept the % on x/y. Use the '--' custom sentinel and store unitless numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each extra layer was applied to the active layer before duplicating it, so 'a, b' imported as 'b, b'. Add the layer first, wait a tick for the store->layer sync guard, then fill it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On -> off left the stops squeezed into 0-25%, so the plain gradient ended a quarter of the way across. Restore the pre-tile stops unless they were edited in between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reset already exists) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for hd-gradients ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
Author
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.




Problem
Follow-up to #133 (repeating gradients). An adversarial review after merge found real bugs on main, each pixel-diffed against Chrome rendering the original CSS:
repeating-linear-gradient(45deg, #000 0 10px, #fff 10px 20px)imported as a plain ramp: px/em/deg stop positions were dropped (diff 127/255).repeating-radial-gradient(circle at 25% 25%, ...)imported blank: theatposition's25%was read as the circle size.at x% y%positions were set under a namedcenter, which wins in the output, so the position was lost.b, binstead ofa, b).Solution
parseGradient.ts: repeating gradients keep length/angle stop positions and length hints; the prelude/stop split uses a real leading-color check; radial size is read only from the part beforeat.importGradient.ts: explicit at-positions go to the custom position (--) with%stripped.GradientImportDialog.svelte: add the layer,await tick(), then apply.GradientRepeat.svelte: Repeat off restores the pre-tile stops if they weren't edited in between.fmtPosso4pxhints round-trip. Preset renamed to "Sun Rays".Impact
Pasting real-world repeating gradients (stripes, rays, offset radials) now gives back what you pasted. Verified in Chromium via the vite dev server: pixel diff vs original 0-0.26/255 for stripes, rays, offset radial/conic; real import dialog for multi-layer; Repeat on/off/undo/redo/URL reload; 390px + 1440px with reduced motion, no overflow, no page errors. vitest 52/52 (5 new tests fail on main), prettier + build pass.
Known leftover: a length hint (
4px) shows blank in the stop editor's number field (it still outputs correctly); 45deg linear imports are handled separately in the next PR.🤖 Generated with Claude Code