Skip to content

2.0.4

Compare
Choose a tag to compare
@christhofer christhofer released this 14 Jul 07:52
· 28 commits to main since this release

Fixed bug invalid default value when darkBackground is not defined.

// tailwind.config.js
scrollbar: theme => ({
  DEFAULT: {
    track: {
      background: theme('colors.blue.100'),
    },
    thumb: {
      background: theme('colors.blue.300'),
    },
    hover: {
      background: theme('colors.blue.600'),
    },
  },
}),

// expected behavior as of docs:
theme('scrollbar.DEFAULT.track.darkBackground') === theme('colors.blue.100')

// previous behavior:
theme('scrollbar.DEFAULT.track.darkBackground') === '#f1f1f1' // fallback value when no config are set

If you need the previous default behavior (you use custom color for light theme, and plugin default gray for dark theme)
Set this value in the config

// tailwind.config.js
theme: {
  scrollbar: theme => ({
    DEFAULT: {
      track: {
        background: (your color),
        darkBackground: '#f1f1f1',
      },
      thumb: {
        background: (your color),
        darkBackground: '#c1c1c1',
      },
      hover: {
        background: (your color),
        darkbackground: '#a8a8a8',
      },
    },
  }),
}