Skip to content

Support Tailwindcss v4 #7

Open
Open
@christhofer

Description

@christhofer

Currently the plugin works out of the box with the new @plugin directive. 👍

@plugin '@gradin/tailwindcss-scrollbar';

But I can't find a way to customize the value of the plugin without the Tailwind config file.
Since v4 now recommends to not use config file anymore, I need to make it support the new @utility and CSS variables via @theme.

// WIP v4 config
@theme {
  --scrollbar-size: 5px; // width or height, default '5px'
  --scrollbar-track-background: lightgray; // default '#f1f1f1'
  --scrollbar-thumb-background: var(--color-gray-400); // default '#c1c1c1'
  --scrollbar-thumb-border-radius: 40px; // default '40px'
  --scrollbar-thumb-hover-background: darkgray; // default '#a8a8a8'
  --scrollbar-thumb-hover-border-radius: 40px; // default '40px'

  /* Other CSS attribute needs to be added manually yourself */
  ::-webkit-scrollbar-track {
    // add any css attributes here
  }
  ::-webkit-scrollbar-thumb {
    // add any css attributes here
  }
  ::-webkit-scrollbar-thumb:hover {
    // add any css attributes here
  }
}

It's almost 2 years since I touch this code, I need to remember all the workflow to update and publish it to npmjs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions