Fantastic - thanks Peter Suter for that solution. Can confirm it does work on MacOS. Here is my variant which works for both horizontal and vertical bars:
def make_scrollbar_styles(
troughcolor='black',
background='grey',
arrowcolor='white',
) -> Tuple[str, str]:
"""
Style the scrollbars. Usage:
parent_frame = ... # tk.Frame(...) or tk.Tk() or whatever you're using for the parent
hstyle, vstyle = make_scrollbar_styles()
vbar = ttk.Scrollbar(parent_frame, orient='vertical', style=vstyle)
hbar = ttk.Scrollbar(parent_frame, orient='horizontal', style=hstyle)
"""
style = Style()
for is_hori in (True, False):
v = "Horizontal" if is_hori else "Vertical"
style.element_create(f'CustomScrollbarStyle.{v}.Scrollbar.trough', 'from', 'default')
style.element_create(f'CustomScrollbarStyle.{v}.Scrollbar.thumb', 'from', 'default')
style.element_create(f'CustomScrollbarStyle.{v}.Scrollbar.leftarrow', 'from', 'default')
style.element_create(f'CustomScrollbarStyle.{v}.Scrollbar.rightarrow', 'from', 'default')
style.element_create(f'CustomScrollbarStyle.{v}.Scrollbar.grip', 'from', 'default')
style.layout(
f'CustomScrollbarStyle.{v}.TScrollbar',
[(f'CustomScrollbarStyle.{v}.Scrollbar.trough', {
'children': [
# Commenting in these 2 lines adds arrows (at least horizontally)
# (f'CustomScrollbarStyle.{v}.Scrollbar.leftarrow', {'side': 'left', 'sticky': ''}) if is_hori else (f'CustomScrollbarStyle.{v}.Scrollbar.uparrow', {'side': 'top', 'sticky': ''}),
# (f'CustomScrollbarStyle.{v}.Scrollbar.rightarrow', {'side': 'right', 'sticky': ''}) if is_hori else (f'CustomScrollbarStyle.{v}.Scrollbar.downarrow', {'side': 'bottom', 'sticky': ''}),
(f'CustomScrollbarStyle.{v}.Scrollbar.thumb', {
'unit': '1',
'children': [(f'CustomScrollbarStyle.{v}.Scrollbar.grip', {'sticky': ''})],
'sticky': 'nswe'}
)
],
'sticky': 'we' if is_hori else 'ns'}),
])
style.configure(f'CustomScrollbarStyle.{v}.TScrollbar', troughcolor=troughcolor, background=background, arrowcolor=arrowcolor)
# Comment in the following to customize disable/active colors, whatever that means
# style.map(f'CustomScrollbarStyle.{v}.TScrollbar', background=[('pressed', '!disabled', disabledcolor), ('active', 'orange')])
return "CustomScrollbarStyle.Horizontal.TScrollbar", "CustomScrollbarStyle.Vertical.TScrollbar"