Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fractional pixel size getting rounded for headingFontSize config option #11963

@jrieke

Description

@jrieke

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

When setting one of the values of headingFontSize to "39.5px", the corresponding heading is getting set to 40px. Not a huge thing but it was a bit annoying because I didn't realize whether everything works correctly.

We should probably also check that this works correctly for other font size config options.

Reproducible Code Example

import streamlit as st

st.title("Hello")


# config.toml
[theme]
headingFontSizes = ["39.5px", "32px", "24px"]

Steps To Reproduce

No response

Expected Behavior

The title should be 39.5px

Current Behavior

The title is 40px

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.47.0
  • Python version:
  • Operating System:
  • Browser:

Additional Information

No response

Metadata

Metadata

Assignees

Labels

feature:themingRelated to themingpriority:P3Medium prioritystatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions