@@ -43,9 +43,12 @@ <h2 class="section-header mt-5">Getting started</h2>
43
43
< p >
44
44
< em > dash-bootstrap-components</ em > relies on < a > Twitter
45
45
Bootstrap</ a > . To use this package, inject the Bootstrap
46
- stylesheet into your application:
46
+ stylesheet into your application. For convenience, links to
47
+ Bootstrap CSS hosted on
48
+ < a href =https://www.bootstrapcdn.com/ > bootstrapcdn</ a >
49
+ are included as part of the < code > themes</ code > module:
47
50
</ p >
48
- < pre > < code class ="language-python "> external_stylesheets = ["https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" ]
51
+ < pre > < code class ="language-python "> external_stylesheets = [dbc.themes.BOOTSTRAP ]
49
52
50
53
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)</ code > </ pre >
51
54
< h2 class ="section-header mt-5 "> Layout</ h2 >
@@ -61,8 +64,6 @@ <h2 class="section-header mt-5">Layout</h2>
61
64
import dash_core_components as dcc
62
65
import dash_html_components as html
63
66
64
- external_stylesheets = ["https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"]
65
-
66
67
_navbar = dbc.Navbar(
67
68
brand="Demo",
68
69
brand_href="#",
@@ -114,7 +115,7 @@ <h2 class="section-header mt-5">Layout</h2>
114
115
115
116
app = Dash(
116
117
__name__,
117
- external_stylesheets=external_stylesheets
118
+ external_stylesheets=[dbc.themes.BOOTSTRAP],
118
119
)
119
120
120
121
app.layout = html.Div([_navbar, _body])
@@ -137,12 +138,12 @@ <h2 class="section-header mt-5">Customising the stylesheet</h2>
137
138
A good way to start customising the stylesheet is to use
138
139
an alternative pre-compiled theme. < a
139
140
href ="https://bootswatch.com/ "> Bootswatch</ a > is a great
140
- place to find new themes. To use one of these themes, you
141
- can use < a
142
- href =" https://www.bootstrapcdn.com/bootswatch/ " > a CDN </ a >
143
- with the < code > external_stylesheets </ code > argument :
141
+ place to find new themes. Links to CDNs for each of the Bootswatch
142
+ styles are also included in < code > themes </ code > , and can be used
143
+ with the < code > external_stylesheets </ code > argument of the
144
+ < code > Dash </ code > constructor :
144
145
</ p >
145
- < pre > < code class ="language-python "> external_stylesheets = ["https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/cerulean/bootstrap.min.css" ]
146
+ < pre > < code class ="language-python "> external_stylesheets = [dbc.themes.CERULEAN ]
146
147
147
148
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)</ code > </ pre >
148
149
< p >
0 commit comments