Skip to content

Commit

Permalink
refactor: move fonts import to css file
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorozenko committed Apr 5, 2024
1 parent f9d788e commit 9ce019c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 1 addition & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@
logger.remove()
logger.add(sys.stderr, level=app_settings.log_level)

# External resources, like CSS and JS files
# Can be moved to a separate file
google_fonts_tag = ui.TagList(
ui.tags.link(rel="stylesheet", href="https://fonts.googleapis.com/css2?family=Roboto"),
ui.tags.link(rel="stylesheet", href="https://fonts.googleapis.com/css2?family=Maven+Pro"),
)

# Combine clean shiny UI with CSS and external resources
ui_with_css = ui.TagList(ui.tags.link(href="style.css", rel="stylesheet"), google_fonts_tag, get_dashboard_ui())
ui_with_css = ui.TagList(ui.tags.link(href="style.css", rel="stylesheet"), get_dashboard_ui())

app_dir = Path(__file__).parent
app = App(ui_with_css, server, static_assets=app_dir / "www")
4 changes: 4 additions & 0 deletions www/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@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');
@import url('https://fonts.googleapis.com/css2?family=Maven+Pro:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;1,400;1,500&display=swap');

body {
font-family: 'Roboto', sans-serif;
background-color: #f0f6ff;
Expand Down

0 comments on commit 9ce019c

Please sign in to comment.