Refactor implementation and improve package resolution#32
Merged
Conversation
- Compare algorithms with hsluv-javascript 1.0.2; no numerical changes needed - Deduplicate public API functions via private _to-color() helper - Refactor args-hsl into _normalize-hue and _normalize-percent helpers - Mark internal conversion helpers as private with _ prefix - Add package exports for modern Sass pkg: URL support - Document CLI usage with --load-path and --pkg-importer options - Refresh package-lock.json version to match package.json
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.
Summary
Compared the Sass implementation against the latest hsluv-javascript reference (v1.0.2). The algorithms already match, so no numerical changes were needed.
Changes
src/_hsluv.scss): Deduplicatedhsluv,hpluv,hsluva,hpluvainto a shared_to-color()helper.src/_conversions.scss): Splitargs-hsl()into_normalize-hue()and_normalize-percent()helpers._lch.scss,_rgb.scss, and_xyz.scsswith a_prefix so they are not forwarded as public API.exportsmap topackage.jsonso the package works with Sass' modernpkg:hsluv-sassURL importer.sass --load-path=node_modulessass --pkg-importer=nodewithpkg:hsluv-sasspackage-lock.jsonso its version matchespackage.json.Verification
npm testpasses: 57,370 passed, 0 failednpm run lintpasses@use "hsluv-sass"(with load path) and@use "pkg:hsluv-sass"compile the README example correctly.