holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.77k stars 519 forks source link

tabulator default font size is too large #7100

Open samimia-swks opened 3 months ago

samimia-swks commented 3 months ago

Using panel 1.4.4 with bootstrap template, I have noticed that normal text (e.g. markdown panel) renders in 12px size but the tabulator widget uses 16px, which looks pretty odd:

image

There is no option I can see to adjust the font size of the tabulator widget. I feel like either the default should be adjusted or a mechanism to easily change font should be provided.

As a workaround, I am using this custom css stylesheet:

tabulator_css = ".tabulator-cell {font-size: 12px;} .tabulator-col-title {font-size: 12px;}"
maximlt commented 1 month ago

@samimia-swks thanks for reporting this issue. The Tabulator JavaScript library Panel depends on to implement the widget has different font size values based on the theme used. For instance, it differs between Bootstrap 3 (14 px) and Bootstrap 4/5 (16px).

It may be that Panel should set better font sizes in general. In that case, when a user sets a specific theme it also makes sense to respect the theme. We should at least document how to set the font size of a Tabulator widget with CSS like you did.

maximlt commented 2 weeks ago

@thuydotm updated the docs, keeping it open for the UX discussion.