Skip to content

Commit ea45643

Browse files
Release 1.47.0 (#1308)
* Update streamlit.json * Remove 1.20 and 1.21 * Add 1.47.0 release notes * What's new * Embedded apps * Update config-toml.md * Cheat sheet * Theming overview examples * Config format * New theming config options * Bump release date to 7/16 * TOML formatting
1 parent 12f29e0 commit ea45643

File tree

54 files changed

+32183
-27357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+32183
-27357
lines changed

content/develop/api-reference/configuration/config-toml.md

Lines changed: 374 additions & 52 deletions
Large diffs are not rendered by default.

content/develop/concepts/configuration/theming-colors-and-borders.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following two configuration options can only be applied to the whole app:
3232

3333
- `theme.base` sets the default colors for your app's theme to match one of Streamlit's two default themes (`"light"` or `"dark"`). If any theme configuation option is used and `theme.base` is not set, then Streamlit will use `"light"`.
3434
- `theme.showSidebarBorder` sets the visibility of the border between the sidebar and the main body of your app.
35+
- `theme.chartCategoricalColors` and `theme.chartSequentialColors` set the series colors for Plotly, Altair, and Vega-Lite charts.
3536

3637
The following configuration options can be set separately for the sidebar by using the `[theme.sidebar]` table instead of the `[theme]` table in `config.toml`:
3738

@@ -40,11 +41,13 @@ The following configuration options can be set separately for the sidebar by usi
4041
- `theme.secondaryBackgroundColor`
4142
- `theme.textColor`
4243
- `theme.linkColor`
44+
- `theme.linkUnderline`
4345
- `theme.codeBackgroundColor`
4446
- `theme.baseRadius`
4547
- `theme.buttonRadius`
4648
- `theme.borderColor`
4749
- `theme.dataframeBorderColor`
50+
- `theme.dataframeHeaderBackgroundColor`
4851
- `theme.showWidgetBorder`
4952

5053
For brevity, on the rest of this page, theming configuration options will not include the `theme.` or `theme.sidebar.` prefix.
@@ -81,17 +84,15 @@ primaryColor="darkGoldrod"
8184

8285
<Cloud name="doc-theming-color-primarycolor" height="350px" />
8386

84-
### `backgroundColor`, `secondaryBackgroundColor`, and `codeBackgroundColor`
87+
### `backgroundColor`, `secondaryBackgroundColor`, `codeBackgroundColor`, and `dataframeHeaderBackgroundColor`
8588

86-
`backgroundColor` defines the background color of your app.
87-
88-
`secondaryBackgroundColor` is used for contrast in the following places:
89-
90-
- The background of input or selection regions for widgets
91-
- Headers within elements like `st.dataframe` and `st.help`
92-
- Code blocks and inline code (if `codeBackgroundColor` is not set)
93-
94-
`codeBackgroundColor` sets the background for code blocks and line code. If `codeBackgroundColor` is not set, Streamlit uses `secondaryBackgroundColor` instead.
89+
- `backgroundColor` defines the background color of your app.
90+
- `secondaryBackgroundColor` is used for contrast in the following places:
91+
- The background of input or selection regions for widgets
92+
- Headers within elements like `st.help` and `st.dataframe` (if `dataframeHeaderBackgroundColor` isn't set)
93+
- Code blocks and inline code (if `codeBackgroundColor` isn't set)
94+
- `codeBackgroundColor` sets the background for code blocks and line code. If `codeBackgroundColor` is not set, Streamlit uses `secondaryBackgroundColor` instead.
95+
- `dataframeHeaderBackgroundColor` sets the background for dataframe headers (including the cells used for row selection and addition, if present).
9596

9697
<Note>
9798

@@ -120,11 +121,11 @@ secondaryBackgroundColor="lavender"
120121

121122
<Cloud name="doc-theming-color-backgroundcolor" height="450px" />
122123

123-
### `textColor` and `linkColor`
124+
### `textColor`, `linkColor`, and `linkUnderline`
124125

125126
You can configure the color of body text and links.
126127

127-
`textColor` sets the default text color for all text in the app except language-highlighting in code blocks, inline code, and links. `linkColor` sets the default font color for all Markdown links in the app.
128+
`textColor` sets the default text color for all text in the app except language-highlighting in code blocks, inline code, and links. `linkColor` sets the default font color for all Markdown links in the app. If `linkUnderline` is set to true (default), the link underline color matches `linkColor`.
128129

129130
The following elements are impacted by `textColor`:
130131

content/develop/concepts/configuration/theming-fonts.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,20 @@ headingFont = "sans-serif"
2424
codeFont = "monospace"
2525
```
2626

27+
You can set the base font weight and size in the `[theme]` table in `config.toml`. These can't be configured separately in the sidebar.
28+
29+
- `theme.baseFontSize` sets the root font size for your app.
30+
- `theme.baseFontWeight` sets the root font weight for your app.
31+
2732
The following configuration options can be set separately for the sidebar by using the `[theme.sidebar]` table instead of the `[theme]` table in `config.toml`:
2833

2934
- `theme.font` sets the default font for all text in the app (except inline code and code blocks). This is `"sans-serif"` (Source Sans) by default.
3035
- `theme.headingFont` sets the default font for all headings in the app. If this is not set, Streamlit uses `theme.font` instead.
36+
- `theme.headingFontSizes` sets the font sizes for `<h1>`-`<h6>` headings.
37+
- `theme.headingFontWeights` sets the font sizes for `<h1>`-`<h6>` headings.
3138
- `theme.codeFont` sets the default font for all inline code and code blocks. This is `"monospace"` (Source Code) by default.
39+
- `theme.codeFontSize` sets the size of code text in code blocks, `st.json`, and `st.help` (but not inline code).
40+
- `theme.codeFontWeight` sets the weight of code text in code blocks, `st.json`, and `st.help` (but not inline code).
3241

3342
When fonts are not declared in `[theme.sidebar]`, Streamlit will inherit each option from `[theme]` before defaulting to less specific options. For example, if `theme.sidebar.headingFont` is not set, Streamlit uses (in order of precedence) `theme.headingFont`, `theme.sidebar.font`, or `theme.font` instead.
3443

@@ -109,14 +118,14 @@ project_directory/
109118

110119
### Example 2: Define an alternative font with static font files
111120

112-
In this configuration example, an alternative font is declared with multiple static font files. For each font, four static files are needed to define the following weight-style pairs:
121+
In this configuration example, an alternative font is declared with multiple static font files. For each font, four static files define the following weight-style pairs:
113122

114123
- normal normal
115124
- normal bold
116125
- italic normal
117126
- italic bold
118127

119-
If one of the files is missing and you try to use its associated weight and style in your app, the user's browser will use the closest font that is available. The following example uses [Tuffy](https://fonts.google.com/specimen/Tuffy) font. The font has four static font files that cover the four weight-style pairs.
128+
If your app uses a font without a matching weight-style definition, the user's browser will use the closest font that is available. The default weight for `<h2>`-`<h6>` headings is semibold (600). For completeness, include additional font files to cover the semibold weight and all the font weights in your app. The following example uses [Tuffy](https://fonts.google.com/specimen/Tuffy) font. The font has four static font files that cover the four weight-style pairs.
120129

121130
A line-by-line explanation of this example is available in a [tutorial](/develop/tutorials/configuration-and-theming/static-fonts).
122131

content/develop/concepts/configuration/theming.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ slug: /develop/concepts/configuration/theming
77

88
In this guide, we provide an overview of theming and visual customization of Streamlit apps. Streamlit themes are defined using configuration options, which are most commonly defined in a `.streamlit/config.toml` file. For more information about setting configuration options, see [Working with configuration options](/develop/concepts/configuration/options). For a complete list of configuration options and definitions, see the API reference for [config.toml](/develop/api-reference/configuration/config.toml#theme).
99

10-
The following options can be set once for your whole app:
10+
The following options can be set in the `[theme]` table of `config.toml` and can't be set separately in the `[theme.sidebar]` table:
1111

1212
- **Base color scheme**: Set your custom theme to inherit from Streamlit's light or dark theme.
13-
- **Font size**: Set the base font size for your app.
13+
- **Base font**: Set the base font weight and size. (This can be configured separately for heading and code font.)
14+
- **Chart color**: Set series colors for Plotly, Altair, and Vega-Lite charts.
15+
- **Sidebar border**: Set the visibility of the sidebar border.
1416

1517
The following options can be configured separately for the main body of your app and the sidebar:
1618

17-
- **Font**: Set the font family for body text, headers, and code.
19+
- **Font family**: Set the font family for body text, headings, and code.
20+
- **Font style**: Set the weight and size of heading and code font, and set visibility of link underlines.
1821
- **Text color**: Set the color of body text and links.
1922
- **Primary color**: Set the color of interactive elements and highlights.
20-
- **Background color**: Set the color of app, widget, and code block backgrounds.
23+
- **Background color**: Set the color of app, widget, code block, and dataframe header backgrounds.
2124
- **Border radius**: Set the roundness of elements and widgets.
22-
- **Border color**: Set the color and visibility of element, widget, and sidebar borders.
25+
- **Border color**: Set the color and visibility of element, widget, sidebar, and dataframe borders.
2326

2427
## Example themes
2528

content/develop/quick-references/api-cheat-sheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ slug: /develop/quick-reference/cheat-sheet
55

66
# Streamlit API cheat sheet
77

8-
This is a summary of the docs for the latest version of Streamlit, [v1.46.0](https://pypi.org/project/streamlit/1.46.0/).
8+
This is a summary of the docs for the latest version of Streamlit, [v1.47.0](https://pypi.org/project/streamlit/1.47.0/).
99

1010
<Masonry>
1111

0 commit comments

Comments
 (0)