posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.87k stars 69 forks source link

Add ability to specify CSS classes in `tab_style()` #161

Open rich-iannone opened 9 months ago

rich-iannone commented 9 months ago

Right now the tab_style() method allows for the addition of CSS style rules in targeted locations / tags. You can target various locations with loc.*, and use style.* (like style.text()) to generate a subset of available style rules.

And while we populate tags with CSS classes (which works in conjunction with our SCSS style sheet, modifiable through use of tab_options()) during HTML rendering, there is no way for the user to use the Great Tables API to simply add classes.

Allowing the user to add classes would be useful especially since we could utilize CSS classes not generated through Great Tables (i.e., available elsewhere in the DOM). We need to expose options for whether CSS styles/classes should be appended to existing (current behavior) or should force a replacement.

machow commented 4 months ago

@schloerke mentioned this would useful