Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [3.0.0](v2.0.1...v3.0.0) (2023-11-23) ### ⚠ BREAKING CHANGES * Renames the following CSS custom properties: `--cp-border-color` → `--cp-color-border`, `--cp-border-width` → `--cp-width-border`, `--cp-color-space-width` → `--cp-width-color-space`, `--cp-focus-color` → `--cp-color-focus` (see README.md for the full list of supported custom properties). * Removes the following CSS custom properties: `--cp-border` (direct replacement: `var(--cp-width-border) solid var(--cp-color-border)`), `--cp-focus-outline` (direct replacement: `2px solid var(--cp-color-focus)`). * Removes the module specifier `yet-another-color-picker/dist/ColorPicker.css`. **How to update**: Use `yet-another-color-picker/styles` instead. * Removes the module specifier `yet-another-color-picker/dist/ColorPicker.d.ts`. **How to update**: Import from `yet-another-color-picker` instead. * Changes how color objects provided to the `color` property are handled. Color objects no longer use values that are constrained to the range [0, 1] (except for any alpha channel values). **How to update**: Multiply any value of objects you pass to the `color` property by the number in parentheses corresponding to the right color channel: For HSL: h (360), s (100), l (100). For HWB: h (360), w (100), b (100). For RGB: r (255), g (255), b (255). * Changes the data emitted by the `color-change` event such that the values on the `colors` object are no longer constrained to the range [0, 1] (except for any alpha channel values). **How to update**: Divide any value of objects from the `colors` object you mkae use of by the number in parentheses corresponding to the right color channel: For HSL: h (360), s (100), l (100). For HWB: h (360), w (100), b (100). For RGB: r (255), g (255), b (255). ### Features * feat: add module specifier yet-another-color-picker/styles ([17fee1d](17fee1d)) Adds the module specifier `yet-another-color-picker/styles` which resolves to the color picker styles (i.e. `dist/ColorPicker.css`). **BREAKING CHANGE**: Removes the module specifier `yet-another-color-picker/dist/ColorPicker.css`. **How to update**: Use `yet-another-color-picker/styles` instead. * feat: make theming using custom properties easier ([0c1d5b6](0c1d5b6)) Simplifies theming of the color picker GUI with CSS custom properties by making better use of the CSS cascade. Customizing the custom properties (e.g. `--cp-focus-color`) can now be done on any ancestor element of `.cp-color-picker` in addition to `.cp-color-picker` itself. For example, you can set `--cp-focus-color: orange` on `:root` and it will work. Adds the following CSS custom properties for theming: `--cp-color-background-input`, `--cp-color-background`, `--cp-color-text-input`, `--cp-color-text`, `--cp-font-family`, `--cp-font-size` (see README.md for the full list of supported custom properties). **BREAKING CHANGE**: Renames the following CSS custom properties: `--cp-border-color` → `--cp-color-border`, `--cp-border-width` → `--cp-width-border`, `--cp-color-space-width` → `--cp-width-color-space`, `--cp-focus-color` → `--cp-color-focus` (see README.md for the full list of supported custom properties). **BREAKING CHANGE**: Removes the following CSS custom properties: `--cp-border` (direct replacement: `var(--cp-width-border) solid var(--cp-color-border)`), `--cp-focus-outline` (direct replacement: `2px solid var(--cp-color-focus)`). * feat: support all angle values as input ([ec7944e](ec7944e)) Adds support for the angle value units `deg`, `grad`, `rad`, and `turn` when entering hues (see https://www.w3.org/TR/css-values-4/#angle-value). Stops normalizing angle values to the range [0, 360) (e.g. a hue value of 450 will no longer be processed as 90). ### Bug Fixes * fix: color property being listed as accepting ColorHsv ([c4084a8](c4084a8)) * fix: integers with trailing zeros being incorrectly rounded ([a7ec5cf](a7ec5cf)) Fixes cases where integers would be incorrectly rounded and lose their trailing zeros (only affects representation of color values as CSS color strings, e.g. when copying). ### Miscellaneous Chores * chore: remove dist/ColorPicker.d.ts module specifier ([c21138f](c21138f)) **BREAKING CHANGE**: Removes the module specifier `yet-another-color-picker/dist/ColorPicker.d.ts`. **How to update**: Import from `yet-another-color-picker` instead. ### Code Refactoring * refactor: change color channels to not be constrained to the range [0, 1] ([6161e74](6161e74)) Changes how color objects are processed (via the `color` property), stored, and emitted (via the `color-change` event) such that the representation of the current color doesn't have its values constrained to the range [0, 1] (inclusive) anymore. Instead, the values are now stored as close as possible to the native representation in CSS (e.g. the hue value 270 is now stored as 270 instead of 0.75). Alpha channel values continue to be stored in the range [0, 1]. **BREAKING CHANGE**: Changes how color objects provided to the `color` property are handled. Color objects no longer use values that are constrained to the range [0, 1] (except for any alpha channel values). **How to update**: Multiply any value of objects you pass to the `color` property by the number in parentheses corresponding to the right color channel: For HSL: h (360), s (100), l (100). For HWB: h (360), w (100), b (100). For RGB: r (255), g (255), b (255). **BREAKING CHANGE**: Changes the data emitted by the `color-change` event such that the values on the `colors` object are no longer constrained to the range [0, 1] (except for any alpha channel values). **How to update**: Divide any value of objects from the `colors` object you mkae use of by the number in parentheses corresponding to the right color channel: For HSL: h (360), s (100), l (100). For HWB: h (360), w (100), b (100). For RGB: r (255), g (255), b (255).
- Loading branch information