Skip to content

Commit

Permalink
🔡 Update default core Gradio font (#9204)
Browse files Browse the repository at this point in the history
* change sans font from Source Sans Pro to Asap

* change misc refs to Source Sans Pro

* add changeset

* revert old changes

* add changeset

* replace asap with IBM Plex Sans

* add changeset

* repalce asaps with ibm plex

* tweak

---------

Co-authored-by: gradio-pr-bot <[email protected]>
  • Loading branch information
hannahblair and gradio-pr-bot authored Aug 29, 2024
1 parent 6773c4d commit 3c73f00
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 12 deletions.
11 changes: 11 additions & 0 deletions .changeset/pink-shirts-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@gradio/lite": minor
"@gradio/theme": minor
"@self/cdn-test": minor
"@self/component-test": minor
"@self/storybook": minor
"gradio": minor
"website": minor
---

feat:🔡 Update default core Gradio font
2 changes: 1 addition & 1 deletion gradio/themes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def __init__(
spacing_size: sizes.Size | str = sizes.spacing_md,
radius_size: sizes.Size | str = sizes.radius_md,
font: fonts.Font | str | Iterable[fonts.Font | str] = (
fonts.GoogleFont("Source Sans Pro"),
fonts.GoogleFont("IBM Plex Sans"),
"ui-sans-serif",
"system-ui",
"sans-serif",
Expand Down
2 changes: 1 addition & 1 deletion gradio/themes/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(
radius_size: sizes.Size | str = sizes.radius_md,
text_size: sizes.Size | str = sizes.text_md,
font: fonts.Font | str | Iterable[fonts.Font | str] = (
fonts.GoogleFont("Source Sans Pro"),
fonts.GoogleFont("IBM Plex Sans"),
"ui-sans-serif",
"system-ui",
"sans-serif",
Expand Down
2 changes: 1 addition & 1 deletion guides/09_other-tutorials/theming-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ You could also create your own custom `Size` objects and pass them in.

The final 2 constructor arguments set the fonts of the theme. You can pass a list of fonts to each of these arguments to specify fallbacks. If you provide a string, it will be loaded as a system font. If you provide a `gradio.themes.GoogleFont`, the font will be loaded from Google Fonts.

- `font`: This sets the primary font of the theme. In the default theme, this is set to `gradio.themes.GoogleFont("Source Sans Pro")`.
- `font`: This sets the primary font of the theme. In the default theme, this is set to `gradio.themes.GoogleFont("IBM Plex Sans")`.
- `font_mono`: This sets the monospace font of the theme. In the default theme, this is set to `gradio.themes.GoogleFont("IBM Plex Mono")`.

You could modify these values such as the following:
Expand Down
2 changes: 1 addition & 1 deletion guides/cn/07_other-tutorials/theming-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ with gr.Blocks(theme=gr.themes.Default(spacing_size=gr.themes.sizes.spacing_sm,

最后的 2 个构造函数参数设置主题的字体。您可以将一系列字体传递给这些参数,以指定回退字体。如果提供了字符串,它将被加载为系统字体。如果提供了 `gradio.themes.GoogleFont`,则将从 Google Fonts 加载该字体。

- `font`:此设置主题的主要字体。在默认主题中,此值设置为 `gradio.themes.GoogleFont("Source Sans Pro")`
- `font`:此设置主题的主要字体。在默认主题中,此值设置为 `gradio.themes.GoogleFont("IBM Plex Sans")`
- `font_mono`:此设置主题的等宽字体。在默认主题中,此值设置为 `gradio.themes.GoogleFont("IBM Plex Mono")`

您可以修改这些值,例如以下方式:
Expand Down
2 changes: 1 addition & 1 deletion js/_cdn-test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
html {
/* background: #111; */
/* color: #eee; */
font-family: Source Sans Pro;
font-family: IBM Plex Sans;
}
</style>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion js/_website/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
theme: {
extend: {
fontFamily: {
sans: ["Source Sans Pro", ...defaultTheme.fontFamily.sans],
sans: ["IBM Plex Sans", ...defaultTheme.fontFamily.sans],
mono: ["IBM Plex Mono", ...defaultTheme.fontFamily.mono]
},
colors: {
Expand Down
4 changes: 2 additions & 2 deletions js/component-test/src/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
--text-lg: 16px;
--text-xl: 22px;
--text-xxl: 26px;
--font: "Source Sans Pro", "ui-sans-serif", "system-ui", sans-serif;
--font: "IBM Plex Sans", "ui-sans-serif", "system-ui", sans-serif;
--font-mono: "IBM Plex Mono", "ui-monospace", "Consolas", monospace;
--body-background-fill: var(--background-fill-primary);
--body-text-color: var(--neutral-800);
Expand Down Expand Up @@ -432,7 +432,7 @@
--text-lg: 16px;
--text-xl: 22px;
--text-xxl: 26px;
--font: "Source Sans Pro", "ui-sans-serif", "system-ui", sans-serif;
--font: "IBM Plex Sans", "ui-sans-serif", "system-ui", sans-serif;
--font-mono: "IBM Plex Mono", "ui-monospace", "Consolas", monospace;
--body-text-size: var(--text-md);
--body-text-weight: 400;
Expand Down
4 changes: 2 additions & 2 deletions js/lite/src/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
--text-lg: 16px;
--text-xl: 22px;
--text-xxl: 26px;
--font: 'Source Sans Pro', 'ui-sans-serif', 'system-ui', sans-serif;
--font: 'IBM Plex Sans', 'ui-sans-serif', 'system-ui', sans-serif;
--font-mono: 'IBM Plex Mono', 'ui-monospace', 'Consolas', monospace;
--body-background-fill: var(--background-fill-primary);
--body-text-color: var(--neutral-800);
Expand Down Expand Up @@ -351,7 +351,7 @@
--text-lg: 16px;
--text-xl: 22px;
--text-xxl: 26px;
--font: 'Source Sans Pro', 'ui-sans-serif', 'system-ui', sans-serif;
--font: 'IBM Plex Sans', 'ui-sans-serif', 'system-ui', sans-serif;
--font-mono: 'IBM Plex Mono', 'ui-monospace', 'Consolas', monospace;
--body-text-size: var(--text-md);
--body-text-weight: 400;
Expand Down
2 changes: 1 addition & 1 deletion js/storybook/themeLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default create({
brandImage: Logo,
brandTarget: "_blank",

fontBase: '"Source Sans Pro", sans-serif',
fontBase: '"IBM Plex Sans", sans-serif',
fontCode: "monospace",

// theme colours
Expand Down
2 changes: 1 addition & 1 deletion js/theme/src/pollen.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = defineConfig((pollen) => {
},
font: {
...pollen.font,
sans: `Source Sans Pro, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,
sans: `IBM Plex Sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,
mono: `IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`
},
radius: {
Expand Down

0 comments on commit 3c73f00

Please sign in to comment.