---
name: css-custom-scrollbar-designer
description: "Generates working cross-browser CSS for a custom scrollbar, with your colors, thickness, and hover effects, using both WebKit rules and the Firefox properties. Use when a web developer wants CSS that restyles scrollbars with specific colors and thickness across WebKit and Firefox browsers. Do not use for building a JavaScript scroll component or styling scrollbars in a native app. Related topics: design, css, coding."
---

# CSS Custom Scrollbar Designer

Generates working cross-browser CSS for a custom scrollbar, with your colors, thickness, and hover effects, using both WebKit rules and the Firefox properties.

## When to use

Use this skill when a web developer wants CSS that restyles scrollbars with specific colors and thickness across WebKit and Firefox browsers. Do not use it for building a JavaScript scroll component or styling scrollbars in a native app.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Pick the selectors for the scope given and write the WebKit pseudo-element rules for the track, thumb, and size.
3. Add the rounded corners and the thumb hover state if they were requested.
4. Write the Firefox rules with scrollbar-color and scrollbar-width and map the thickness to the nearest allowed value.
5. Add a short comment per browser block and a closing note on what each browser ignores.

## Inputs

- **Thumb color** (free text, e.g. "#ff0000")
- **Track color** (free text, e.g. "#f1f1f1")
- **Scrollbar thickness in px** (number from 1 to 30)
- **Round the thumb corners** (choose one: Yes, No)
- **Add a hover effect to the thumb** (choose one: Yes, No)
- **Target browsers** (choose any: WebKit (Chrome and Safari), Firefox (scrollbar-color))
- **Scope** (free text, e.g. "Whole page or a class name such as .panel")

## Output

One CSS block with a WebKit section and a Firefox section, each commented, plus a short note on browser limits.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### CSS Custom Scrollbar Designer

Write CSS for a custom scrollbar.

- Thumb color: {{Thumb color}}
- Track color: {{Track color}}
- Scrollbar thickness in px: {{Scrollbar thickness in px}}
- Round the thumb corners: {{Round the thumb corners}}
- Add a hover effect to the thumb: {{Add a hover effect to the thumb}}
- Target browsers: {{Target browsers}}
- Scope: {{Scope}}

Output the CSS in one block. For WebKit, use the ::-webkit-scrollbar, ::-webkit-scrollbar-track, and ::-webkit-scrollbar-thumb pseudo-elements, with the thumb hover state if asked. For Firefox, use scrollbar-color and scrollbar-width, mapping the thickness to thin or auto since Firefox does not take pixel values.

Apply the rules to the scope given. Add a one-line comment above each browser block and finish with a short note on what each browser will not honour, so I know what to expect.

## Pitfalls

- Giving Firefox a pixel width, which it ignores, so the scrollbar looks wrong there.
- Styling the thumb without a visible contrast against the track, which makes it hard to see.
- Applying the rules to the whole page when the owner only wanted one panel.
