Skip to content

Change st.metric font size and weight through theming #12300

@jrieke

Description

@jrieke

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

The value of st.metric uses a larger font size, which isn't available through theming today. It would be great to add this!

Why?

Many BI dashboards use specific styles for metrics and it's important we can replicate that, e.g. like in here:

Image

How?

Add two new theming parameters:

  • metricValueFontSize
  • metricValueFontWeight

These should take the same values as other font size/weight parameters. I don't think it's worth adding that for the delta values right now but we should keep that option open for the future.

Note that one other solution could be to tie the design of the metric value to some header level (e.g. h3). But I don't think that works for every kind of theme.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

feature:st.metricRelated to the `st.metric` elementfeature:themingRelated to theminggood first issueGood for newcomers to the codebasetype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions