Closed
Description
Each of the scrollbar styles say that they take a percentage that is the opacity to use. However, it appears that this value gets ignored. With this code:
from textual.app import App, ComposeResult
from textual.containers import VerticalScroll
from textual.widgets import Static
class ScrollBarPercentageApp(App[None]):
CSS = """
Screen {
layout: horizontal;
}
VerticalScroll {
scrollbar-size-vertical: 10;
&#no-pcent {
background: $surface;
scrollbar-background: $surface;
scrollbar-background-active: $surface;
scrollbar-background-hover: $surface;
}
&#pcent {
background: $surface 10%;
scrollbar-background: $surface 10%;
scrollbar-background-active: $surface 10%;
scrollbar-background-hover: $surface 10%;
}
}
"""
def compose(self) -> ComposeResult:
with VerticalScroll(id="no-pcent"):
yield Static(
"\n".join(
f"This is some text {n}" for n in range(100)
)
)
with VerticalScroll(id="pcent"):
yield Static(
"\n".join(
f"This is some text {n}" for n in range(100)
)
)
if __name__ == "__main__":
ScrollBarPercentageApp().run()
the result is this:
Note that on the left the scrollbar background and the container are set to $surface
and they match; on the right they're set to $surface 10%
and they don't match, which the scrollbar background appearing to still be just $surface
.
Metadata
Metadata
Assignees
Labels
No labels