Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
alpha of 100% is the default
  • Loading branch information
RobinMalfait committed Apr 28, 2025
commit cd452e3993fc3fc500cf9afe35132737c79285e7
5 changes: 5 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ export function withAlpha(value: string, alpha: string): string {
alpha = `${alphaAsNumber * 100}%`
}

// No need for `color-mix` if the alpha is `100%`
if (alpha === '100%') {
return value
}

return `color-mix(in oklab, ${value} ${alpha}, transparent)`
}

Expand Down