Skip to content

Commit 0d43a2d

Browse files
adamwathanreinink
andauthored
Remove <alpha-value> from docs (#1868)
* Remove <alpha-value> from docs * Update src/pages/docs/customizing-colors.mdx Co-authored-by: Jonathan Reinink <jonathan@reinink.ca> --------- Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com> Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
1 parent 75867a1 commit 0d43a2d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/pages/docs/customizing-colors.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,24 +373,24 @@ If you'd like to define your colors as CSS variables, you'll need to define thos
373373
}
374374
```
375375

376-
Then define your colors in your configuration file, being sure to include the color space you're using, and the special `<alpha-value>` placeholder that Tailwind will use to inject the alpha value when using an opacity modifier:
376+
Then define your colors in your configuration file, being sure to include the color space you're using and a default alpha value for color spaces like `rgba` where the alpha channel is required:
377377

378378
```js {{ filename: 'tailwind.config.js' }}
379379
/** @type {import('tailwindcss').Config} */
380380
module.exports = {
381381
theme: {
382382
colors: {
383383
// Using modern `rgb`
384-
primary: 'rgb(var(--color-primary) / <alpha-value>)',
385-
secondary: 'rgb(var(--color-secondary) / <alpha-value>)',
384+
primary: 'rgb(var(--color-primary))',
385+
secondary: 'rgb(var(--color-secondary))',
386386

387387
// Using modern `hsl`
388-
primary: 'hsl(var(--color-primary) / <alpha-value>)',
389-
secondary: 'hsl(var(--color-secondary) / <alpha-value>)',
388+
primary: 'hsl(var(--color-primary))',
389+
secondary: 'hsl(var(--color-secondary))',
390390

391391
// Using legacy `rgba`
392-
primary: 'rgba(var(--color-primary), <alpha-value>)',
393-
secondary: 'rgba(var(--color-secondary), <alpha-value>)',
392+
primary: 'rgba(var(--color-primary), 1)',
393+
secondary: 'rgba(var(--color-secondary), 1)',
394394
}
395395
}
396396
}
@@ -405,13 +405,13 @@ When defining your colors this way, make sure that the format of your CSS variab
405405

406406
@layer base {
407407
:root {
408-
/* For rgb(255 115 179 / <alpha-value>) */
408+
/* For rgb(255 115 179 / 1) */
409409
--color-primary: 255 115 179;
410410

411-
/* For hsl(198deg 93% 60% / <alpha-value>) */
412-
--color-primary: 198deg 93% 60%;
411+
/* For hsl(333deg 100% 73% / 1) */
412+
--color-primary: 333deg 100% 73%;
413413

414-
/* For rgba(255, 115, 179, <alpha-value>) */
414+
/* For rgba(255, 115, 179, 1) */
415415
--color-primary: 255, 115, 179;
416416
}
417417
}

0 commit comments

Comments
 (0)