Skip to content

Commit

Permalink
Switch to offline css and font files:
Browse files Browse the repository at this point in the history
- The bootstrap themes are not more loaded from CDN
- Theme is available offline
- Suggestion from pull-request:
#1
Thanks to user Frischid!!!
  • Loading branch information
EinEinfach committed May 12, 2023
1 parent c7d692a commit 54f1365
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CaSSAndRA/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
frontend_logger.setLevel(logging.ERROR)

# package imports
import os
import dash
from dash import html, dcc
import dash_bootstrap_components as dbc
Expand All @@ -34,15 +35,16 @@ def serve_layout():

def main() -> None:
backendserver.start()

assets_path = os.path.dirname(__file__) +'/src/assets'

app = dash.Dash(
__name__,
use_pages=True, # turn on Dash pages
pages_folder='src/pages',
external_stylesheets=[
dbc.themes.MINTY,
dbc.icons.BOOTSTRAP
], # fetch the proper css items we want
# external_stylesheets=[
# dbc.themes.MINTY,
# dbc.icons.BOOTSTRAP
# ], # fetch the proper css items we want
meta_tags=[
{ # check if device is a mobile device. This is a must if you do any mobile styling
'name': 'viewport',
Expand All @@ -51,7 +53,9 @@ def main() -> None:
],
suppress_callback_exceptions=True,
prevent_initial_callbacks='initial_duplicate',
title='CASSANDRA'
title='CASSANDRA',
update_title = 'CASSANDRA updating...',
assets_folder=assets_path,
)
app.layout = serve_layout # set the layout to the serve_layout function

Expand Down
5 changes: 5 additions & 0 deletions CaSSAndRA/src/assets/bootstrap-icons.min.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions CaSSAndRA/src/assets/bootstrap.min.css

Large diffs are not rendered by default.

Binary file added CaSSAndRA/src/assets/fonts/bootstrap-icons.woff
Binary file not shown.
Binary file added CaSSAndRA/src/assets/fonts/bootstrap-icons.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions CaSSAndRA/src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,33 @@
.button-group {
margin-left: 10px;
}

/* montserrat-regular - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: url('fonts/montserrat-v25-latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
url('fonts/montserrat-v25-latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* montserrat-500 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
src: url('fonts/montserrat-v25-latin-500.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
url('fonts/montserrat-v25-latin-500.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* montserrat-700 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Montserrat';
font-style: normal;
font-weight: 700;
src: url('fonts/montserrat-v25-latin-700.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
url('fonts/montserrat-v25-latin-700.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

0 comments on commit 54f1365

Please sign in to comment.