Skip to content

Commit 84c2703

Browse files
committed
Slightly customize RTD theme to use Symfony's feel
The goal is not to match the symfony.com style, that would be wasting our time. This introduces a couple customizations according to RTD's official extension points, to have a bit more relatable feeling in the demo docs.
1 parent 88d7c91 commit 84c2703

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

_build/_static/rtd_custom.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
body {
2+
font-family:Lucida Grande,Lucida Sans Unicode,Lucida Sans,Geneva,Verdana,sans-serif !important;
3+
}
4+
5+
h1, h2, h3, h4, h5, h6 {
6+
font-family:Georgia,Times New Roman,Times,serif !important;
7+
line-height:1.2 !important;
8+
margin-top:0 !important;
9+
margin-bottom:.5em !important;
10+
}
11+
p, .rst-content li{
12+
font-size:14px !important;
13+
line-height:1.45 !important;
14+
}
15+
.wy-menu-vertical a {
16+
font-size:14px !important;
17+
padding-right:0 !important;
18+
}
19+
20+
.highlight {
21+
background:#1e2125 !important;
22+
color:#fafafa !important;
23+
}

_build/_static/symfony-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

_build/conf.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,15 @@
140140
# The theme to use for HTML and HTML Help pages. See the documentation for
141141
# a list of builtin themes.
142142
html_theme = "sphinx_rtd_theme"
143-
html_theme_path = ["_themes", ]
144143

145144
# Theme options are theme-specific and customize the look and feel of a theme
146145
# further. For a list of options available for each theme, see the
147146
# documentation.
148-
#html_theme_options = {}
147+
html_theme_options = {
148+
'logo_only': True,
149+
'prev_next_buttons_location': None,
150+
'style_nav_header_background': '#f0f0f0'
151+
}
149152

150153
# Add any paths that contain custom themes here, relative to this directory.
151154
#html_theme_path = []
@@ -159,7 +162,7 @@
159162

160163
# The name of an image file (relative to this directory) to place at the top
161164
# of the sidebar.
162-
#html_logo = None
165+
html_logo = '_static/symfony-logo.svg'
163166

164167
# The name of an image file (within the static path) to use as favicon of the
165168
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -169,7 +172,8 @@
169172
# Add any paths that contain custom static files (such as style sheets) here,
170173
# relative to this directory. They are copied after the builtin static files,
171174
# so a file named "default.css" will overwrite the builtin "default.css".
172-
#html_static_path = ['_static']
175+
html_static_path = ['_static']
176+
html_css_files = ['rtd_custom.css']
173177

174178
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
175179
# using the given strftime format.

0 commit comments

Comments
 (0)