trame: inject custom css

In a trame + paraview based application, all I want to do is inject this following css. How can I do that?

html {
  overflow-y: hidden
}

What’s happening is I am getting this y-scrollbar (highlighted below) and I want to get rid of it. Just adding this little snippet above using the browser’s developer tools panel does the trick.

You can use the trame.widgets.client.Style() to inject any CSS. That example perform dynamic update. But for your usecase, you can simply do the following

from trame.widgets import client
# [...]

with xxx as layout:
   client.Style("html { overflow-y: hidden; }")
   # [...]

HTH,

Seb

Sweet. client.Style(...) did the trick. Thanks!

1 Like