gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com/
Apache License 2.0
7.1k stars 316 forks source link

Label properties on cards/widgets #519

Open NetLancer opened 1 year ago

NetLancer commented 1 year ago

Hi everybody and many thanks for this Grist super-invention!:) Here I've been tinkering a lot and specifically looking for the way(s) to modify the font-size/weight, alignment and possibly (text)color too, at least for non-table widgets, given that the latter's kinda more of an aesthetic representative of raw-table data. As i need those widgets to be side-by-side with master table on the page (specifics in my laptop now placed off & i'm using the smarthone) and those widgets supposed to add clarity and visual appeal.. At least, the ability to change the font-size a bit on labels would come very handy. Is there a way to do so, or else if it is to be implemented in future releases ? Thank you

NetLancer commented 1 year ago

Seems like my question above should be marked as "Feature request" type

NetLancer commented 1 year ago

Just to see how barely distinguishable wdget-labels look (in my case): SS-how-labels-are-dim.jpg

dsagal commented 1 year ago

There are several "Themes" available in the Creator Panel (https://support.getgrist.com/widget-card/#selecting-theme), but I think all of them have very small labels.

It's possible to add another theme (which is mainly a matter of writing suitable CSS), and also possible to add new theme options. The main difficulty would be to figure out what would be a good addition that helps in a range of use cases.

NetLancer commented 1 year ago

I think something that makes label look distinct form the very field values - maybe choosing from several predefined colors (not crazy many) & several discrete font-sizes (smallest--smaller--small--norm--big--bigger--biggest) would be OK (my personal concern :))

dmduco commented 1 year ago

How about providing an option to apply some custom CSS on top of the selected theme?

For example, this theme: Screenshot 2023-05-31 at 08 59 10

Could easily be altered to something like this: Screenshot 2023-05-31 at 08 58 48

This gives styling flexibility without the need to build a custom widget.

For true flexibility though, we would need a unique selector to target cards and records. For example, the selected div has no unique identifiers that can be targeted. Screenshot 2023-05-31 at 09 04 19

An option would be to add a unique identifier at the widget and field (= column) level. For example, at field level a custom attribute with the field id could be added: Screenshot 2023-05-31 at 09 12 52

This way, everything can be targeted nicely: Screenshot 2023-05-31 at 09 09 35

NetLancer commented 1 year ago

I think consistency(uniformity) among labels per widget should also be a consideration, so i see it as an option for user to add custom CSS to ALL labels (within single widget) only or even limit that to few customization options (e.g. fontSize, fontWeight, color, textAligh) if provided via GUI. Again, its only about labels (fields are configurable - with some styling options, moreover conditional styling should stay intact).

Sorry i have to confess i'm currently using electron version, so if there's some minor differences in appearence which i might overlook ..:)