Skip to content

Commit 9ce019c

Browse files
committed
refactor: move fonts import to css file
1 parent f9d788e commit 9ce019c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

app.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,8 @@
1212
logger.remove()
1313
logger.add(sys.stderr, level=app_settings.log_level)
1414

15-
# External resources, like CSS and JS files
16-
# Can be moved to a separate file
17-
google_fonts_tag = ui.TagList(
18-
ui.tags.link(rel="stylesheet", href="https://fonts.googleapis.com/css2?family=Roboto"),
19-
ui.tags.link(rel="stylesheet", href="https://fonts.googleapis.com/css2?family=Maven+Pro"),
20-
)
21-
2215
# Combine clean shiny UI with CSS and external resources
23-
ui_with_css = ui.TagList(ui.tags.link(href="style.css", rel="stylesheet"), google_fonts_tag, get_dashboard_ui())
16+
ui_with_css = ui.TagList(ui.tags.link(href="style.css", rel="stylesheet"), get_dashboard_ui())
2417

2518
app_dir = Path(__file__).parent
2619
app = App(ui_with_css, server, static_assets=app_dir / "www")

www/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');
2+
@import url('https://fonts.googleapis.com/css2?family=Maven+Pro:wght@300;400;500;600;700&display=swap');
3+
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;1,400;1,500&display=swap');
4+
15
body {
26
font-family: 'Roboto', sans-serif;
37
background-color: #f0f6ff;

0 commit comments

Comments
 (0)