|
20 | 20 | import diskcache |
21 | 21 | from dash import DiskcacheManager |
22 | 22 |
|
23 | | -from demo_configs import APP_TITLE, THEME_COLOR, THEME_COLOR_SECONDARY |
| 23 | +from demo_configs import APP_TITLE |
24 | 24 | from demo_interface import create_interface |
| 25 | +import dash_mantine_components as dmc |
25 | 26 |
|
26 | 27 | # Essential for initializing callbacks. Do not remove. |
27 | 28 | import demo_callbacks |
|
51 | 52 |
|
52 | 53 | app.config.suppress_callback_exceptions = True |
53 | 54 |
|
| 55 | +app.index_string = """ |
| 56 | +<!DOCTYPE html> |
| 57 | +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> |
| 58 | + <head> |
| 59 | + {%metas%} |
| 60 | + <title>{%title%}</title> |
| 61 | + {%favicon%} |
| 62 | + <link rel="stylesheet" href="https://use.typekit.net/fyq0cum.css"> |
| 63 | + {%css%} |
| 64 | + </head> |
| 65 | + <body> |
| 66 | + {%app_entry%} |
| 67 | + <footer> |
| 68 | + {%config%} |
| 69 | + {%scripts%} |
| 70 | + {%renderer%} |
| 71 | + </footer> |
| 72 | + </body> |
| 73 | +</html> |
| 74 | +""" |
| 75 | + |
54 | 76 | # Parse debug argument |
55 | 77 | parser = argparse.ArgumentParser(description="Dash debug setting.") |
56 | 78 | parser.add_argument( |
|
65 | 87 | print(f"\nDebug has been set to: {DEBUG}") |
66 | 88 | if not DEBUG: |
67 | 89 | print( |
68 | | - "The app will not show live code updates and the Dash debug menu will be hidden.", |
69 | | - "If editting code while the app is running, run the app with `python app.py --debug`.\n", |
| 90 | + "Code changes will not be reflected in the app interface and the Dash debug menu will be hidden.", |
| 91 | + "If editing code while the app is running, run the app with `python app.py --debug`.\n", |
70 | 92 | sep="\n", |
71 | 93 | ) |
72 | 94 |
|
73 | | -# Generates css file and variable using THEME_COLOR and THEME_COLOR_SECONDARY settings |
74 | | -css = f"""/* Automatically generated theme settings css file, see app.py */ |
75 | | -:root {{ |
76 | | - --theme: {THEME_COLOR}; |
77 | | - --theme-secondary: {THEME_COLOR_SECONDARY}; |
78 | | -}} |
79 | | -""" |
80 | | -with open("assets/__generated_theme.css", "w") as f: |
81 | | - f.write(css) |
82 | | - |
83 | 95 |
|
84 | 96 | if __name__ == "__main__": |
85 | 97 | # Imports the Dash HTML code and sets it in the app. |
86 | 98 | # Creates the visual layout and app (see `demo_interface.py`) |
87 | | - app.layout = create_interface() |
| 99 | + app.layout = dmc.MantineProvider(create_interface()) |
88 | 100 |
|
89 | 101 | # Run the server |
90 | 102 | app.run(debug=DEBUG) |
0 commit comments