monks/scrollbar_width

The scrollbar-width property allows the author to set the desired thickness of an element’s scrollbars when they are shown.

The purpose of the scrollbar-width is to optimize the space occupied by the scrollbar on a page or element; the purpose is not related to scrollbar aesthetics. The scrollbar-width predefined keyword values indicate to the user agent whether a normal or smaller scrollbar should be rendered. Avoid using none, as hiding a scrollbar negatively impacts accessibility.

For elements that are scrollable only via programmatic means and not by direct user interaction, use the {{cssxref(“overflow”)}} property with a value of hidden rather than scrollbar-width: none.

Values

pub const auto_: #(String, String)
  • : The default scrollbar width for the platform.
pub const inherit: #(String, String)
pub const initial: #(String, String)
pub const none: #(String, String)
  • : No scrollbar shown, however the element will still be scrollable.> [!NOTE]> User Agents must apply any scrollbar-width value set on the root element to the viewport.
pub fn raw(value: String) -> #(String, String)

Enter a raw string value for scrollbar-width

pub const revert: #(String, String)
pub const revert_layer: #(String, String)
pub const thin: #(String, String)
  • : A thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width.
pub const unset: #(String, String)
pub fn var(variable: String) -> #(String, String)

Enter a variable name to be used for scrollbar-width. It will be wrapped in var() and have -- prepended.

Search Document