Height of progress bar in Anvil Extras

I want to use the progress bar from the Anvil Extras repo.
However, it seems I can’t find a way to set its height.
Is there a way to set that?

For the records, I have found a way by directly setting the CSS attributes of the progress bar element:

import anvil.js
from anvil.js.window import document

def set_prog_bar_style(dom_element, height=25, margin_top=10):
    # Set overall ("outher") style
    prog_bar = anvil.js.get_dom_node(dom_element)
    prog_bar.style.border = "1px solid lightgray"
    prog_bar.style.marginTop = f"{margin_top}px"
    prog_bar.style.height = f"{height}px"

    # Set progress ("inner") style
    for i in range(7):
        prog_bar = prog_bar.firstChild
    prog_bar.style.height = f"{height-2}px"

This might be a bit cumbersome, but does the trick.
I am open for better solutions of course :slight_smile:

1 Like