forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bold font in header showing less weight (streamlit#9395)
## Describe your changes ### Context It's been a longstanding [issue](streamlit#4428) where setting H1 to bold actually set the font less bold. Example: ``` st.write("# Hello **World**") # or st.title("Hello **World**) ``` would result in  This is because the [default font-weight of `h1` is 700](https://github.com/streamlit/streamlit/blob/develop/frontend/lib/src/theme/globalStyles.ts#L181) and [default of `strong` or `b` is 600](https://github.com/streamlit/streamlit/blob/develop/frontend/lib/src/theme/globalStyles.ts#L313) I consulted Jessi and we land on this expected behavior: **Setting text to bold in headers will NOT change its font-weight** ### This change I proposed overriding the css font-weight for `b` & `strong` inside `h1` to the default 700 and left font-weight for `h2+` as-is (they already match the bolded text's weight) Also added an e2e test for font weights of all headers. ## GitHub Issue Link (if applicable) streamlit#4428 ## Testing Plan - Unit Tests (JS) ✅ - E2E Tests --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
- Loading branch information
1 parent
f686cb6
commit 15d60c9
Showing
18 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
Binary file modified
BIN
+9 Bytes
(100%)
.../__snapshots__/linux/st_markdown_test/st_latex-formula[dark_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-57 Bytes
(99%)
...ht/__snapshots__/linux/st_markdown_test/st_latex-formula[dark_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+86 Bytes
(100%)
...__snapshots__/linux/st_markdown_test/st_latex-formula[light_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6 Bytes
(100%)
...t/__snapshots__/linux/st_markdown_test/st_latex-formula[light_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27 Bytes
(100%)
...ht/__snapshots__/linux/st_markdown_test/st_latex-latex[dark_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-20 Bytes
(99%)
...ight/__snapshots__/linux/st_markdown_test/st_latex-latex[dark_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+28 Bytes
(100%)
...t/__snapshots__/linux/st_markdown_test/st_latex-latex[light_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-10 Bytes
(99%)
...ght/__snapshots__/linux/st_markdown_test/st_latex-latex[light_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
...ht/__snapshots__/linux/st_markdown_test/st_latex-sympy[dark_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6 Bytes
(99%)
...t/__snapshots__/linux/st_markdown_test/st_latex-sympy[light_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.9 KB
...napshots__/linux/st_markdown_test/st_markdown-headers_bold_syntax[chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29 KB
...snapshots__/linux/st_markdown_test/st_markdown-headers_bold_syntax[firefox].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.9 KB
..._snapshots__/linux/st_markdown_test/st_markdown-headers_bold_syntax[webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
...__snapshots__/linux/st_markdown_test/st_markdown-with_large_image[chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7 Bytes
(100%)
...t/__snapshots__/linux/st_markdown_test/st_markdown-with_large_image[webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters