-
Notifications
You must be signed in to change notification settings - Fork 45
Add support for 'scrollbarColor' theme property #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,9 +122,9 @@ const generateScrollbarSizeUtilities = ({ preferPseudoElements }) => ({ | |
| * @param {typedefs.TailwindPlugin} tailwind - Tailwind's plugin object | ||
| */ | ||
| const addColorUtilities = ({ matchUtilities, theme }) => { | ||
| const themeColors = flattenColorPalette(theme('colors')); | ||
| const themeColors = theme('scrollbarColor') ?? theme('colors'); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key The new (undocumented) pattern Tailwind 4 is following for this is kebab-case (e.g. See tailwindlabs/tailwindcss#16512, tailwindlabs/tailwindcss#15757 Happily, it looks like |
||
| const colors = Object.fromEntries( | ||
| Object.entries(themeColors).map(([k, v]) => [k, toColorValue(v)]) | ||
| Object.entries(flattenColorPalette(themeColors)).map(([k, v]) => [k, toColorValue(v)]) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this line becomes (even more) cognitively heavy by moving |
||
| ); | ||
|
|
||
| COMPONENTS.forEach(component => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shadows your global
colorsdefinitions. If you've definedscrollbarColorin your config, this change would prevent you from using any colours for scrollbars that aren't ascrollbarColor.