From 233e1b29346a1e1bfaf893a2d81a4f9488869626 Mon Sep 17 00:00:00 2001 From: uncenter Date: Mon, 9 Feb 2026 10:26:47 -0500 Subject: [PATCH] revert: "feat(lib/lib.less): add rgbify/hslify config options (#2018)" (#2133) This reverts commit 168f796a82565be5d8f9d7547d624524fcb482a2. --- .../docs/contributing/standard-library.md | 32 -------------- lib/lib.less | 42 ++++--------------- 2 files changed, 7 insertions(+), 67 deletions(-) diff --git a/docs/src/content/docs/contributing/standard-library.md b/docs/src/content/docs/contributing/standard-library.md index f3bd6334..54d5674b 100644 --- a/docs/src/content/docs/contributing/standard-library.md +++ b/docs/src/content/docs/contributing/standard-library.md @@ -19,16 +19,6 @@ The standard library exposes a `#lib` namespace. The standard library palette mixin provides Less variable definitions for hex colors and CSS filters from the palette. Call the mixin at the top of the `#catppuccin` mixin to inject the variables into the userstyle context. This is used in all userstyles. -#### Options - -##### `@rgbify-default-sep` - -Sets the default separator for the `rgbify` utility. Can be either `"comma"` or `"space"`. Defaults to `"comma"`. - -##### `@hslify-default-sep` - -Sets the default separator for the `hslify` utility. Can be either `"comma"` or `"space"`. Defaults to `"comma"`. - ### `#lib.defaults()` The standard library defaults mixin provides a set of default styles for text selection and native/input elements. This is generally applied in all userstyles, with some exceptions. @@ -37,42 +27,20 @@ The standard library defaults mixin provides a set of default styles for text se The standard library `rgbify` mixin is a utility mixin for extracting the color in `r, g, b` format from a palette variable. -#### Options - -##### `@color` - -##### `@spaces`/`@commas` - -_Optional_ - -Depending on `.palette()` configuration, either enables space separation in commas-by-default mode or comma separation in spaces-by-default mode. - #### Examples ```less --my-variable-rgb: #lib.rgbify(@base) []; // -> 30, 30, 46 ---my-variable-rgb-spaces: #lib.rgbify(@base, true) []; // -> 30 30 46 ``` ### `#lib.hslify()` The standard library `hslify` mixin is a utility mixin for extracting the color in `h, s, l` format from a palette variable. -#### Options - -##### `@color` - -##### `@spaces`/`@commas` - -_Optional_ - -Depending on `.palette()` configuration, either enables space separation in commas-by-default mode or comma separation in spaces-by-default mode. - #### Examples ```less --my-variable-hsl: #lib.hslify(@base) []; // -> 240, 21.052631578947366%, 14.901960784313726% ---my-variable-hsl-spaces: #lib.hslify(@base, true) []; // -> 240 21.052631578947366% 14.901960784313726% ``` ### `#lib.css-variables()` diff --git a/lib/lib.less b/lib/lib.less index 12b554f3..63a5021d 100644 --- a/lib/lib.less +++ b/lib/lib.less @@ -15,7 +15,7 @@ }; #lib { - .palette(@rgbify-default-sep: "comma", @hslify-default-sep: "comma") { + .palette() { @rosewater: @catppuccin[@@flavor][@rosewater]; @flamingo: @catppuccin[@@flavor][@flamingo]; @pink: @catppuccin[@@flavor][@pink]; @@ -88,42 +88,14 @@ } } - // rgbify() - & when (@rgbify-default-sep = "comma") { - .rgbify(@color, @spaces: false) { - @with-spaces: red(@color) green(@color) blue(@color); - @with-commas: red(@color), green(@color), blue(@color); - @result: if(@spaces = true, @with-spaces, @with-commas); - } - } - & when (@rgbify-default-sep = "space") { - .rgbify(@color, @commas: false) { - @with-spaces: red(@color) green(@color) blue(@color); - @with-commas: red(@color), green(@color), blue(@color); - @result: if(@commas = true, @with-commas, @with-spaces); - } + .rgbify(@color) { + @rgb: red(@color), green(@color), blue(@color); } - // hslify() - & when (@hslify-default-sep = "comma") { - .hslify(@color, @spaces: false) { - @result: if( - @spaces = true, - e(%("%s %s% %s%", hue(@color), saturation(@color), lightness(@color))), - e(%("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color))) - ); - } - } - & when (@hslify-default-sep = "space") { - .hslify(@color, @commas: false) { - @result: if( - @commas = true, - e( - %("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color)) - ), - e(%("%s %s% %s%", hue(@color), saturation(@color), lightness(@color))) - ); - } + .hslify(@color) { + @raw: e( + %("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color)) + ); } .css-variables() {