Skip to content

v-table scrollbar thumb colors are hardcoded (potential PR) #326

@ryrobes

Description

@ryrobes

Hello! Judging by the code comments this appears to have been on the TODO list at some point or at least considered (the comments mention a possible :thumb-style explicitly, so I just followed that lead).

Issue: Using [:parts :simple-wrapper :v-scroll/h-scroll :style] the user can change the background of the v-table scroll bar area, but never the thumb color since they are hardcoded and not accessible via parts.

Solution: Since the thumb color is just background-color of regular a re-com/box I had to create "pseudo css keys" to access and replace the various states of it (default, grab, hover).

Diff compare: master...ryrobes:re-com:master

  ;; thumb box css map can be accessed via:
   [:parts :simple-wrapper :v-scroll/h-scroll :thumb-style] 

    {:drag-color       "#ffffff"    ;; gets subbed in as background-color for thumb on drag
     :hover-color      "#ffffff99"  ;; gets subbed in as background-color for thumb on hover
     :background-color "#eeeeee"    ;; default thumb color
     ;(plus all regular CSS keys work as intended on the thumb)
     }

This works for my use case, and I can now fully style the v-table scrollbars to match my theme.

Not sure if this warrants a PR, but let me know, I can easily send it - since I feel like the core team would have implemented it differently, but figure I'd give a heads up here if anyone else runs into this issue.

Can be tested out via [org.clojars.ryrobes/re-com "2.13.2-122-d2b8d22-SNAPSHOT"].
Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions