scrollbar-style

A package for detecting whether the scrollbar style is overlay or legacy

Scrollbar Style

This package detects the preferred scroller style for Atom on OS X using the +preferredScrollerStyle method on NSScroller. For compatibility, this library always returns "legacy" on Windows and Linux.

The module exports a reactive-style behavior representing the current scrollbar style. You can get the behavior's value with ::getValue or subscribe to the current and all future values with ::onValue. Callbacks passed to ::onValue are called immediately and then whenever the scrollbar style preference changes.

scrollbarStyle = require 'scrollbar-style'
scrollbarStyle.getValue() # ==> 'legacy' or 'overlay' 
scrollbarStyle.onValue (style) -> # ...