removeElementScrollColors function

List<String>? removeElementScrollColors(
  1. Element element
)

Removes element scroll colors CSS properties set by setElementScrollColors.

Implementation

List<String>? removeElementScrollColors(Element element) {
  element.style.removeProperty('scrollbar-width');
  element.style.removeProperty('scrollbar-color');

  var scrollClassIDs =
      element.classes.where((c) => c.startsWith('__scroll_color__')).toList();

  if (isNotEmptyObject(scrollClassIDs)) {
    element.classes.removeAll(scrollClassIDs);
    return scrollClassIDs;
  } else {
    return null;
  }
}