question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autoprefixer cannot generate prefix for custom scrollbar

See original GitHub issue

I use grunt-postcss to generate css prefix.

Configuration as follows:

processors: [
   require('autoprefixer') {
      browsers: [
        '> 0.04%'
      ]
    }
]

Sass as follows:

@mixin custom-scroll($thumb-bgcolor: $gray-background-color, $track-bgcolor: $white-background-color) {
  &::scrollbar {
    background-color: transparent;
    width: 5px;
    height: 5px;
  }

  &::scrollbar-thumb {
    background: $thumb-bgcolor;
    border-radius: 2px;
    min-height: 6px;
    width: 4px;
  }

  &::scrollbar-track {
    background: $track-bgcolor;
    border-radius: 2px;
  }
}

But, autoprefixer cannot generate prefix for scrollbar-xxx, such as -webkit-scrollbar, -webkit-scrollbar-thumb, -webkit-scrollbar-track. It is a bug or it is my wrong configuration?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:8
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
sylvainpolletvillardcommented, Jan 29, 2019

for information, there is ongoing work on this here : https://github.com/pascalduez/postcss-scrollbar

3reactions
aicommented, Jun 5, 2019

@Malvoz my current worries:

  1. The current architecture doesn’t fit creating independent rules from properties. We will need to write complex hacks as we did for Grid.
  2. Hiding scroll bar doesn’t look like a very popular use case.
  3. I got small community feedback for the latest Autoprefixer news, it is not great for motivation. As a result, I am focusing on different fields right now.

Because of these reasons, I do not want to do it on my own. But I will help you make a pull request and will accept and release it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - ::-webkit-scrollbar not working on firefox
I highly recommend you add something like Autoprefixer to your build pipeline. It will manage adding prefixes where needed, not adding them ...
Read more >
Is Vendor Prefixing Dead? - CSS-Tricks
In CSS we use vendor prefixes for properties, values, @-rules that are: ... scollbar-width, Methods of styling scrollbar color and width.
Read more >
Configure Autoprefixer correctly to output -ms-grid prefixes.
Goal 1: Ensure your build tasks have Autoprefixer enabled and configured to generate grid vendor prefixes. If you're using Laravel Mix, ...
Read more >
Create custom scrollbars using CSS - YouTube
Having a custom scrollbar can help tie the branding of a site together on the page, as well as help it match an...
Read more >
Sass mixin for scrollbar styling - CodePen
Because I can't ever remember the right syntax for scrollbars styling in WebKit, here is a little Sass mixin to do it for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found