Skip to content

Commit 6c5b443

Browse files
authored
Merge pull request #91 from ASIDataScience/document-themes-module
Document themes module
2 parents 69a7d09 + f6d4c16 commit 6c5b443

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

docs/templates/index.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ <h2 class="section-header mt-5">Getting started</h2>
4343
<p>
4444
<em>dash-bootstrap-components</em> relies on <a>Twitter
4545
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:
4750
</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]
4952

5053
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)</code></pre>
5154
<h2 class="section-header mt-5">Layout</h2>
@@ -61,8 +64,6 @@ <h2 class="section-header mt-5">Layout</h2>
6164
import dash_core_components as dcc
6265
import dash_html_components as html
6366

64-
external_stylesheets = ["https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"]
65-
6667
_navbar = dbc.Navbar(
6768
brand="Demo",
6869
brand_href="#",
@@ -114,7 +115,7 @@ <h2 class="section-header mt-5">Layout</h2>
114115

115116
app = Dash(
116117
__name__,
117-
external_stylesheets=external_stylesheets
118+
external_stylesheets=[dbc.themes.BOOTSTRAP],
118119
)
119120

120121
app.layout = html.Div([_navbar, _body])
@@ -137,12 +138,12 @@ <h2 class="section-header mt-5">Customising the stylesheet</h2>
137138
A good way to start customising the stylesheet is to use
138139
an alternative pre-compiled theme. <a
139140
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:
144145
</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]
146147

147148
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)</code></pre>
148149
<p>

0 commit comments

Comments
 (0)