tailwindcss-custom-colors 1.0.14 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,121 +1,55 @@
1
- ## Installation
2
-
3
- ```bash
4
- # With npm
5
- npm i tailwindcss-custom-colors@latest
6
-
7
- # With yarn
8
- yarn add tailwindcss-custom-colors@latest
9
- ```
10
-
11
- [![npm version](https://badge.fury.io/js/tailwindcss-custom-colors.svg)](https://badge.fury.io/js/tailwindcss-custom-colors)
12
-
13
- <!-- ![NPM](https://img.shields.io/npm/l/tailwindcss-custom-colors)
14
- ![GitHub Repo stars](https://img.shields.io/github/stars/ibodev1/tailwindcss-custom-colors?style=social)
15
- ![node-current](https://img.shields.io/node/v/tailwindcss-custom-colors)
16
- ![GitHub last commit](https://img.shields.io/github/last-commit/ibodev1/tailwindcss-custom-colors)
17
- ![npm](https://img.shields.io/npm/dw/tailwindcss-custom-colors)
18
- ![GitHub top language](https://img.shields.io/github/languages/top/ibodev1/tailwindcss-custom-colors) -->
19
-
20
- ## Usage
21
-
22
- ### Import
23
-
24
- ```js
25
- import { generateConfig } from "tailwindcss-custom-colors";
26
- ```
27
-
28
- ```js
29
- import { generateStyleVariables } from "tailwindcss-custom-colors";
30
- ```
1
+ # tailwindcss-custom-colors
31
2
 
32
- ### Options
3
+ Generate a full Tailwind CSS shade scale, the matching CSS variables and
4
+ automatic contrast colors from a single hex color.
33
5
 
34
- The `Options` interface allows you to customize the behavior of the package. Below are the available options and their default values.
6
+ [![npm version](https://img.shields.io/npm/v/tailwindcss-custom-colors)](https://www.npmjs.com/package/tailwindcss-custom-colors)
7
+ [![npm downloads](https://img.shields.io/npm/dm/tailwindcss-custom-colors)](https://www.npmjs.com/package/tailwindcss-custom-colors)
8
+ [![license](https://img.shields.io/npm/l/tailwindcss-custom-colors)](LICENSE)
35
9
 
36
- #### Available Options
10
+ You declare `primary` once. The package gives you `primary-50` through
11
+ `primary-950`, plus `primary`, `primary-contrast` and `primary-complement`, all
12
+ wired to CSS variables so a theme can be swapped at runtime.
37
13
 
38
- - `suffixMultiplier` (optional): Determines the multiplier for suffixes. Possible values are `100`, `10`, or `1`. Default is `100`.
39
- - `variablePrefix` (optional): Specifies a prefix for variable names. Default is `undefined`.
40
- - `contrast` (optional): If set to `true`, calculates the contrast. Default is `true`.
41
- - `complement` (optional): If set to `true`, calculates the complementary color. Default is `true`.
42
- - `classification` (optional): An object containing color classifications for light and dark themes. Default is `{ light: "#FFFFFF", dark: "#000000" }`.
43
- - `light`: Hex color for light theme. Default is `"#FFFFFF"`.
44
- - `dark`: Hex color for dark theme. Default is `"#000000"`.
45
- - `steps` (optional): Determines the step values for shades. Possible values are `100` or `50`. Default is `100`.
46
- - `default` (optional): If set to `true`, uses the default configuration. Default is `true`.
47
-
48
- #### Default Options
49
-
50
- The `defaultOptions` object represents the default configuration for the package:
51
-
52
- ```typescript
53
- const defaultOptions: DefaultOptions = {
54
- suffixMultiplier: 100,
55
- variablePrefix: undefined,
56
- contrast: true,
57
- complement: true,
58
- classification: {
59
- light: "#FFFFFF",
60
- dark: "#000000",
61
- },
62
- steps: 100,
63
- default: true,
64
- };
65
- ```
66
-
67
- ### generateConfig()
68
-
69
- ```js
70
- const extendedColors = generateConfig(colorNames, options);
71
- ```
72
-
73
- #### The generateConfig function takes the following parameters:
74
-
75
- - `colorNames`: An array of color names or a single color name.
76
- - `options` (optional): An object of options that allows you to customize the generated colors. The available options are `suffixMultiplier` (default: `100`), which determines the suffix used to generate variables names (e.g `[1, 10, 100]`) and `variablePrefix` (default: `undefined`), which determines the prefix for the css variable name, none by default.
77
-
78
- The function returns a config object for Tailwind CSS with the specified color names and their respective tints.
79
-
80
- ### generateStyleVariables()
14
+ ## Installation
81
15
 
82
- ```js
83
- const variables = generateStyleVariables(colorParams, options);
16
+ ```bash
17
+ yarn add tailwindcss-custom-colors
18
+ # or
19
+ npm install tailwindcss-custom-colors
84
20
  ```
85
21
 
86
- #### The generateStyleVariables function takes the following parameters:
87
-
88
- - `colorParams`: An array of color params or a single color params including a color (hex) and a name.
89
- - `options` (optional): An object of options that allows you to customize the generated colors. The available options are `suffixMultiplier` (default: `100`), which determines the suffix used to generate variables names (e.g `[1, 10, 100]`) and `variablePrefix` (default: `undefined`), which determines the prefix for the css variable name, none by default.
22
+ The package is published as CommonJS so it can be required from a
23
+ `tailwind.config.js`.
90
24
 
91
- ## Example
25
+ ## Usage
92
26
 
93
- Extend your tailwind config
27
+ Two functions, used together. `generateConfig` produces the Tailwind color
28
+ config, which references CSS variables. `generateStyleVariables` produces the
29
+ values for those variables.
94
30
 
95
- _tailwind.config.js_
31
+ ### Tailwind config
96
32
 
97
33
  ```js
98
34
  /** @type {import('tailwindcss').Config} */
99
- import { generateConfig } from "tailwindcss-custom-colors";
100
-
101
- const extendedColors = generateConfig(["primary", "secondary"]);
35
+ const { generateConfig } = require('tailwindcss-custom-colors');
102
36
 
103
37
  module.exports = {
104
- content: ["./src/**/*.{index,vue,js,ts,jsx,tsx}"],
38
+ content: ['./src/**/*.{vue,js,ts,jsx,tsx}'],
105
39
  theme: {
106
40
  extend: {
107
- colors: extendedColors,
41
+ colors: generateConfig(['primary', 'secondary']),
108
42
  },
109
43
  },
110
- plugins: [],
111
44
  };
112
45
  ```
113
46
 
114
- #### Output for `extendedColors`:
47
+ `generateConfig(['primary'])` returns:
115
48
 
116
49
  ```json
117
50
  {
118
51
  "primary": {
52
+ "50": "rgb(var(--primary-50) / <alpha-value>)",
119
53
  "100": "rgb(var(--primary-100) / <alpha-value>)",
120
54
  "200": "rgb(var(--primary-200) / <alpha-value>)",
121
55
  "300": "rgb(var(--primary-300) / <alpha-value>)",
@@ -125,52 +59,38 @@ module.exports = {
125
59
  "700": "rgb(var(--primary-700) / <alpha-value>)",
126
60
  "800": "rgb(var(--primary-800) / <alpha-value>)",
127
61
  "900": "rgb(var(--primary-900) / <alpha-value>)",
62
+ "950": "rgb(var(--primary-950) / <alpha-value>)",
128
63
  "DEFAULT": "rgb(var(--primary) / <alpha-value>)",
129
64
  "contrast": "rgb(var(--primary-contrast) / <alpha-value>)",
130
65
  "complement": "rgb(var(--primary-complement) / <alpha-value>)"
131
- },
132
- "secondary": {
133
- "100": "rgb(var(--secondary-100) / <alpha-value>)",
134
- "200": "rgb(var(--secondary-200) / <alpha-value>)",
135
- "300": "rgb(var(--secondary-300) / <alpha-value>)",
136
- "400": "rgb(var(--secondary-400) / <alpha-value>)",
137
- "500": "rgb(var(--secondary-500) / <alpha-value>)",
138
- "600": "rgb(var(--secondary-600) / <alpha-value>)",
139
- "700": "rgb(var(--secondary-700) / <alpha-value>)",
140
- "800": "rgb(var(--secondary-800) / <alpha-value>)",
141
- "900": "rgb(var(--secondary-900) / <alpha-value>)",
142
- "DEFAULT": "rgb(var(--secondary) / <alpha-value>)",
143
- "contrast": "rgb(var(--secondary-contrast) / <alpha-value>)",
144
- "complement": "rgb(var(--secondary-complement) / <alpha-value>)"
145
66
  }
146
67
  }
147
68
  ```
148
69
 
149
- ### Variables
70
+ Because every shade goes through a CSS variable, `bg-primary-500` follows
71
+ whatever `--primary-500` is set to, and a whole theme can be re-skinned by
72
+ rewriting the variables.
73
+
74
+ ### CSS variables
150
75
 
151
- Generate css variables
76
+ Pass an array of `{ color, name }` pairs. A single object also works.
152
77
 
153
78
  ```js
154
- import { generateStyleVariables } from "tailwindcss-custom-colors";
79
+ const { generateStyleVariables } = require('tailwindcss-custom-colors');
155
80
 
156
- const variables = generateStyleVariables(
157
- {
158
- color: "#940BDF",
159
- name: "primary",
160
- },
161
- {
162
- color: "#FFD534",
163
- name: "secondary",
164
- }
165
- );
81
+ const variables = generateStyleVariables([
82
+ { color: '#940BDF', name: 'primary' },
83
+ { color: '#FFD534', name: 'secondary' },
84
+ ]);
166
85
  ```
167
86
 
168
- #### Output for `variables`:
87
+ Which returns:
169
88
 
170
89
  ```css
171
90
  --primary: 148 11 223;
172
91
  --primary-contrast: 255 255 255;
173
92
  --primary-complement: 0 0 0;
93
+ --primary-50: 231 192 252;
174
94
  --primary-100: 223 172 251;
175
95
  --primary-200: 207 128 249;
176
96
  --primary-300: 188 80 247;
@@ -180,29 +100,84 @@ const variables = generateStyleVariables(
180
100
  --primary-700: 91 6 136;
181
101
  --primary-800: 58 4 88;
182
102
  --primary-900: 29 2 44;
103
+ --primary-950: 16 1 24;
183
104
  --secondary: 255 213 52;
184
105
  --secondary-contrast: 0 0 0;
185
106
  --secondary-complement: 255 255 255;
186
- --secondary-100: 255 263 296;
187
- --secondary-200: 255 251 235;
188
- --secondary-300: 255 239 173;
189
- --secondary-400: 255 226 112;
190
- --secondary-500: 255 213 52;
191
- --secondary-600: 245 196 0;
192
- --secondary-700: 184 147 0;
193
- --secondary-800: 122 98 0;
194
- --secondary-900: 61 49 0;
107
+ /* and --secondary-50 through --secondary-950, same as above */
195
108
  ```
196
109
 
197
- ### Import variables
110
+ Inject them wherever your theme lives:
198
111
 
199
112
  ```js
200
- const style = document.createElement("style");
201
- style.innerHTML = `
202
- @layer base {
203
- :root {
204
- ${variables}
205
- }
206
- }`;
113
+ const style = document.createElement('style');
114
+ style.innerHTML = `@layer base { :root { ${variables} } }`;
207
115
  document.head.appendChild(style);
208
116
  ```
117
+
118
+ ## API
119
+
120
+ ### `generateConfig(names, options?)`
121
+
122
+ `names` is a color name or an array of them. Returns a Tailwind `colors` object
123
+ whose every entry points at a CSS variable.
124
+
125
+ ### `generateConfigWithColors(colorParams, options?)`
126
+
127
+ Same shape as `generateConfig`, but takes `{ color, name }` pairs and inlines the
128
+ computed `rgb()` values instead of referencing CSS variables. Use it when you do
129
+ not want a runtime-swappable theme.
130
+
131
+ ### `generateStyleVariables(colorParams, options?)`
132
+
133
+ Takes `{ color, name }` pairs and returns the CSS variable declarations as a
134
+ string, separated by `;`.
135
+
136
+ ## Options
137
+
138
+ | Option | Type | Default | What it does |
139
+ | ------------------ | --------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------- |
140
+ | `suffixMultiplier` | `100 \| 10 \| 1` | `100` | Scale of the shade suffixes, so `500` becomes `50` or `5` |
141
+ | `variablePrefix` | `string` | `undefined` | Prefix for generated variable names, for example `app` gives `--app-primary-500` |
142
+ | `contrast` | `boolean` | `true` | Emit a `contrast` color, readable on top of the base color |
143
+ | `complement` | `boolean` | `true` | Emit a `complement` color, the inverse of `contrast` |
144
+ | `classification` | `{ light: string, dark: string }` | `{ light: '#FFFFFF', dark: '#000000' }` | The two colors `contrast` and `complement` pick between |
145
+ | `steps` | `100 \| 50` | `100` | `50` adds the half steps, `150`, `250` and so on |
146
+ | `default` | `boolean` | `true` | Emit the unsuffixed `DEFAULT` entry |
147
+ | `extraShades` | `boolean` | `true` | Emit the outer `50` and `950` shades |
148
+
149
+ ## Development
150
+
151
+ ```bash
152
+ yarn install
153
+ yarn verify # lint, format check, typecheck, tests, build
154
+ yarn test:watch
155
+ ```
156
+
157
+ ## Releasing
158
+
159
+ Releases are driven by the commit messages. Push to `main` and CI decides
160
+ whether to publish, from the Conventional Commit prefixes in that push:
161
+
162
+ | Commit | Release |
163
+ | ------------------------------------------------ | ------- |
164
+ | `feat!:`, or a `BREAKING CHANGE:` footer | major |
165
+ | `feat:` | minor |
166
+ | `fix:`, `perf:` | patch |
167
+ | `chore:`, `docs:`, `ci:`, `test:`, anything else | none |
168
+
169
+ The highest bump in the push wins. CI runs `yarn verify`, publishes to npm,
170
+ then commits the version bump and tags it. Nothing to run by hand, and no
171
+ version is bumped by a commit that does not change the published code.
172
+
173
+ To publish without a qualifying commit, run the workflow manually and pick a
174
+ strategy. `current` publishes the version already in `package.json`, which is
175
+ what a first release or a retry after a credentials failure needs.
176
+
177
+ ```bash
178
+ gh workflow run CI --field strategy=minor
179
+ ```
180
+
181
+ ## License
182
+
183
+ MIT. See [LICENSE](LICENSE).
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.generateConfigWithColors = exports.generateStyleVariables = exports.generateConfig = void 0;
7
7
  const chroma_1 = require("./utils/chroma");
8
- const hexToRgb_1 = require("./utils/hexToRgb");
9
8
  const hexToHsl_1 = __importDefault(require("./utils/hexToHsl"));
9
+ const hexToRgb_1 = require("./utils/hexToRgb");
10
10
  const round_1 = __importDefault(require("./utils/round"));
11
11
  const variableName_1 = __importDefault(require("./utils/variableName"));
12
12
  const SHADES = {
@@ -20,8 +20,8 @@ const defaultOptions = {
20
20
  contrast: true,
21
21
  complement: true,
22
22
  classification: {
23
- light: "#FFFFFF",
24
- dark: "#000000",
23
+ light: '#FFFFFF',
24
+ dark: '#000000',
25
25
  },
26
26
  steps: 100,
27
27
  default: true,
@@ -49,10 +49,10 @@ const generateConfig = (colorNames, options) => {
49
49
  DEFAULT: `rgb(var(${(0, variableName_1.default)(colorName, variablePrefix)}) / <alpha-value>)`,
50
50
  };
51
51
  const contrastColor = {
52
- contrast: `rgb(var(${(0, variableName_1.default)(colorName, variablePrefix, "contrast")}) / <alpha-value>)`,
52
+ contrast: `rgb(var(${(0, variableName_1.default)(colorName, variablePrefix, 'contrast')}) / <alpha-value>)`,
53
53
  };
54
54
  const complementColor = {
55
- complement: `rgb(var(${(0, variableName_1.default)(colorName, variablePrefix, "complement")}) / <alpha-value>)`,
55
+ complement: `rgb(var(${(0, variableName_1.default)(colorName, variablePrefix, 'complement')}) / <alpha-value>)`,
56
56
  };
57
57
  const colorTints = {
58
58
  ...(defaultOption ? defaultColor : {}),
@@ -87,10 +87,10 @@ const generateStyleVariables = (colorParams, options) => {
87
87
  `${(0, variableName_1.default)(name, variablePrefix)}: ${(0, hexToRgb_1.hexToRgbString)(color)}`,
88
88
  ];
89
89
  const contrastTintColor = [
90
- `${(0, variableName_1.default)(name, variablePrefix, "contrast")}: ${(0, chroma_1.contrast)(hslColor, classification)}`,
90
+ `${(0, variableName_1.default)(name, variablePrefix, 'contrast')}: ${(0, chroma_1.contrast)(hslColor, classification)}`,
91
91
  ];
92
92
  const complementTintColor = [
93
- `${(0, variableName_1.default)(name, variablePrefix, "complement")}: ${(0, chroma_1.complement)(hslColor, classification)}`,
93
+ `${(0, variableName_1.default)(name, variablePrefix, 'complement')}: ${(0, chroma_1.complement)(hslColor, classification)}`,
94
94
  ];
95
95
  const tintsString = [
96
96
  ...(defaultOption ? defaultTintColor : []),
@@ -115,9 +115,9 @@ const generateStyleVariables = (colorParams, options) => {
115
115
  tintsString.push(`${(0, variableName_1.default)(name, variablePrefix, tintSuffix)}: ${(0, chroma_1.darken)(hslColor, ratio)}`);
116
116
  }
117
117
  });
118
- return tintsString.join(";\n");
118
+ return tintsString.join(';\n');
119
119
  });
120
- return styles.join(";\n");
120
+ return styles.join(';\n');
121
121
  };
122
122
  exports.generateStyleVariables = generateStyleVariables;
123
123
  /**
@@ -127,7 +127,9 @@ exports.generateStyleVariables = generateStyleVariables;
127
127
  * @returns {TailwindColorsConfig} A config object for tailwindcss
128
128
  */
129
129
  const generateConfigWithColors = (colorParams, options) => {
130
- const { suffixMultiplier, variablePrefix, contrast, complement, classification, steps, default: defaultOption, extraShades, } = computeOptions(options || {});
130
+ // No variablePrefix here: this builds the Tailwind config with plain rgb()
131
+ // values, it never emits CSS variable names.
132
+ const { suffixMultiplier, contrast, complement, classification, steps, default: defaultOption, extraShades, } = computeOptions(options || {});
131
133
  const colors = Array.isArray(colorParams) ? colorParams : [colorParams];
132
134
  const config = {};
133
135
  colors.forEach(({ color, name }) => {
@@ -169,4 +171,3 @@ const generateConfigWithColors = (colorParams, options) => {
169
171
  return config;
170
172
  };
171
173
  exports.generateConfigWithColors = generateConfigWithColors;
172
- //# sourceMappingURL=index.js.map
@@ -15,18 +15,31 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.complement = exports.contrast = exports.lighten = exports.darken = void 0;
39
+ exports.darken = darken;
40
+ exports.lighten = lighten;
41
+ exports.contrast = contrast;
42
+ exports.complement = complement;
30
43
  const hexToRgb_1 = __importStar(require("./hexToRgb"));
31
44
  const hslToRgb_1 = __importDefault(require("./hslToRgb"));
32
45
  function darkenHsl(hsl, val) {
@@ -42,21 +55,16 @@ function lightenHsl(hsl, val) {
42
55
  function darken(hsl, val) {
43
56
  return (0, hexToRgb_1.rgbToString)((0, hslToRgb_1.default)(darkenHsl(hsl, val)));
44
57
  }
45
- exports.darken = darken;
46
58
  function lighten(hsl, val) {
47
59
  return (0, hexToRgb_1.rgbToString)((0, hslToRgb_1.default)(lightenHsl(hsl, val)));
48
60
  }
49
- exports.lighten = lighten;
50
61
  function contrast(hsl, classification) {
51
62
  const [r, g, b] = (0, hslToRgb_1.default)(hsl);
52
63
  const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
53
64
  return (0, hexToRgb_1.rgbToString)((0, hexToRgb_1.default)(luminance > 0.5 ? classification.dark : classification.light));
54
65
  }
55
- exports.contrast = contrast;
56
66
  function complement(hsl, classification) {
57
67
  const [r, g, b] = (0, hslToRgb_1.default)(hsl);
58
68
  const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
59
69
  return (0, hexToRgb_1.rgbToString)((0, hexToRgb_1.default)(luminance < 0.5 ? classification.dark : classification.light));
60
70
  }
61
- exports.complement = complement;
62
- //# sourceMappingURL=chroma.js.map
@@ -3,10 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = hexToHsl;
6
7
  const hexToRgb_1 = __importDefault(require("./hexToRgb"));
7
8
  const rgbToHsl_1 = __importDefault(require("./rgbToHsl"));
8
9
  function hexToHsl(hex) {
9
10
  return (0, rgbToHsl_1.default)((0, hexToRgb_1.default)(hex));
10
11
  }
11
- exports.default = hexToHsl;
12
- //# sourceMappingURL=hexToHsl.js.map
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hexToRgbString = exports.rgbToString = void 0;
3
+ exports.default = hexToRgb;
4
+ exports.rgbToString = rgbToString;
5
+ exports.hexToRgbString = hexToRgbString;
4
6
  function hexToRgb(hex) {
5
- const hexString = hex.replace("#", "");
7
+ const hexString = hex.replace('#', '');
6
8
  const validHexRegExp = /^[0-9A-Fa-f]{6}$/;
7
9
  if (!validHexRegExp.test(hexString)) {
8
10
  throw new Error(`Invalid hexadecimal color code: ${hex}`);
@@ -12,13 +14,9 @@ function hexToRgb(hex) {
12
14
  const b = parseInt(hexString.substring(4, 6), 16);
13
15
  return [r, g, b];
14
16
  }
15
- exports.default = hexToRgb;
16
17
  function rgbToString([r, g, b]) {
17
18
  return `${r} ${g} ${b}`;
18
19
  }
19
- exports.rgbToString = rgbToString;
20
20
  function hexToRgbString(hex) {
21
21
  return rgbToString(hexToRgb(hex));
22
22
  }
23
- exports.hexToRgbString = hexToRgbString;
24
- //# sourceMappingURL=hexToRgb.js.map
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = hslToRgb;
6
7
  const round_1 = __importDefault(require("./round"));
7
8
  const hueToRgb = (p, q, t) => {
8
9
  if (t < 0)
@@ -19,7 +20,10 @@ const hueToRgb = (p, q, t) => {
19
20
  };
20
21
  function hslToRgb([h, s, l]) {
21
22
  h /= 360;
22
- l = (0, round_1.default)(l);
23
+ // Lightening a bright color can push l past 1, which would yield rgb
24
+ // components above 255. Saturation and lightness are both defined on [0, 1].
25
+ s = Math.min(1, Math.max(0, s));
26
+ l = (0, round_1.default)(Math.min(1, Math.max(0, l)));
23
27
  let r, g, b;
24
28
  if (s === 0) {
25
29
  r = g = b = l;
@@ -33,5 +37,3 @@ function hslToRgb([h, s, l]) {
33
37
  }
34
38
  return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
35
39
  }
36
- exports.default = hslToRgb;
37
- //# sourceMappingURL=hslToRgb.js.map
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = rgbToHsl;
3
4
  function rgbToHsl([r, g, b]) {
4
5
  // Normalize RGB values to the range [0, 1]
5
6
  const normalizedR = r / 255;
@@ -39,5 +40,3 @@ function rgbToHsl([r, g, b]) {
39
40
  const roundedL = Math.round(l * 100) / 100;
40
41
  return [h, s, roundedL];
41
42
  }
42
- exports.default = rgbToHsl;
43
- //# sourceMappingURL=rgbToHsl.js.map
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = round;
3
4
  function round(val) {
4
5
  return Math.round((val + Number.EPSILON) * 100) / 100;
5
6
  }
6
- exports.default = round;
7
- //# sourceMappingURL=round.js.map
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = variableName;
3
4
  function variableName(name, prefix, tint) {
4
- return `--${prefix ? prefix + "-" : ""}${name}${tint ? "-" + tint : ""}`;
5
+ return `--${prefix ? prefix + '-' : ''}${name}${tint ? '-' + tint : ''}`;
5
6
  }
6
- exports.default = variableName;
7
- //# sourceMappingURL=variableName.js.map
package/package.json CHANGED
@@ -1,36 +1,49 @@
1
1
  {
2
2
  "name": "tailwindcss-custom-colors",
3
- "version": "1.0.14",
4
- "description": "Reactive color shades generator for TailwindCSS",
5
- "author": "quentinjuarez",
3
+ "version": "1.1.0",
4
+ "description": "Generate a full Tailwind CSS shade scale, CSS variables and contrast colors from a single hex color.",
5
+ "keywords": [
6
+ "colors",
7
+ "contrast",
8
+ "css-variables",
9
+ "palette",
10
+ "shades",
11
+ "tailwind",
12
+ "tailwindcss",
13
+ "tints",
14
+ "typescript"
15
+ ],
16
+ "homepage": "https://github.com/quentinjuarez/tailwindcss-custom-colors#readme",
17
+ "bugs": "https://github.com/quentinjuarez/tailwindcss-custom-colors/issues",
18
+ "license": "MIT",
19
+ "author": "quentinjuarez (https://www.quentinjuarez.dev)",
6
20
  "repository": {
7
21
  "type": "git",
8
- "url": "https://github.com/quentinjuarez/tailwindcss-custom-colors"
22
+ "url": "git+https://github.com/quentinjuarez/tailwindcss-custom-colors.git"
9
23
  },
10
- "main": "dist/index.js",
11
24
  "files": [
12
- "dist/**/*"
25
+ "dist"
13
26
  ],
27
+ "main": "dist/index.js",
28
+ "types": "dist/index.d.ts",
14
29
  "scripts": {
15
- "test": "jest",
16
- "build": "tsc",
17
- "patch": "yarn build && npm version patch && git push --follow-tags"
30
+ "build": "rm -rf dist && tsc",
31
+ "test": "vitest run",
32
+ "test:watch": "vitest",
33
+ "typecheck": "tsc --noEmit",
34
+ "lint": "oxlint",
35
+ "lint:fix": "oxlint --fix",
36
+ "format": "oxfmt . '!**/global.d.ts'",
37
+ "format:check": "oxfmt --check . '!**/global.d.ts'",
38
+ "verify": "yarn lint && yarn format:check && yarn typecheck && yarn test && yarn build"
18
39
  },
19
- "keywords": [
20
- "tailwind",
21
- "tailwindcss",
22
- "colors",
23
- "palette",
24
- "shades",
25
- "tints"
26
- ],
27
40
  "devDependencies": {
28
- "@types/jest": "^29.5.3",
29
- "@types/node": "^20.4.4",
30
- "jest": "^29.6.1",
31
- "ts-jest": "^29.1.1",
32
- "typescript": "^5.1.6"
41
+ "@types/node": "^22.10.0",
42
+ "@vitest/coverage-v8": "^4.0.18",
43
+ "oxfmt": "^0.59.0",
44
+ "oxlint": "^1.74.0",
45
+ "typescript": "^5.9.3",
46
+ "vitest": "^4.0.18"
33
47
  },
34
- "license": "MIT",
35
- "packageManager": "yarn@3.5.0"
36
- }
48
+ "packageManager": "yarn@3.8.6"
49
+ }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAKwB;AACxB,+CAAkD;AAClD,gEAAwC;AACxC,0DAAkC;AAClC,wEAAgD;AAEhD,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;CACxE,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AA8BhC,MAAM,cAAc,GAAmB;IACrC,gBAAgB,EAA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AC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AAFD,2BAEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hexToRgb.js","sourceRoot":"","sources":["../../src/utils/hexToRgb.ts"],"names":[],"mappings":";;;AAAA,SAAwB,QAAQ,CAAC,GAAW;IAC1C,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAEvC,MAAM,cAAc,GAAG,kBAAkB,CAAC;IAC1C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;KAC3D;IAED,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACnB,CAAC;AAZD,2BAYC;AAED,SAAgB,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAInC;IACC,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1B,CAAC;AAND,kCAMC;AAED,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC;AAFD,wCAEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hslToRgb.js","sourceRoot":"","sources":["../../src/utils/hslToRgb.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AA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 @@
1
- {"version":3,"file":"variableName.js","sourceRoot":"","sources":["../../src/utils/variableName.ts"],"names":[],"mappings":";;AAAA,SAAwB,YAAY,CAClC,IAAY,EACZ,MAAe,EACf,IAAa;IAEb,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC3E,CAAC;AAND,+BAMC"}