Skip to content

Commit

Permalink
ReadTheDocs theme has an annoying bug of text not being wrapped insid…
Browse files Browse the repository at this point in the history
…e table cells. Each row is extended to fit the text as a single line. For a table with multiple columns and long sentences the table may get wide, with long scrollbar underneath and is not convenient to read. This MR makes the text wrap inside table cells. There is an open PR to fix this issue - readthedocs/sphinx_rtd_theme#432.
  • Loading branch information
krzychb committed Apr 9, 2018
1 parent d56a44a commit 43fb803
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/_static/theme_overrides.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* override table width restrictions */
@media screen and (min-width: 767px) {

.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}

.wy-table-responsive {
overflow: visible !important;
}
}
7 changes: 6 additions & 1 deletion docs/conf_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ['../_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -327,3 +327,8 @@
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# otherwise, readthedocs.org uses their theme by default, so no need to specify it

# Override RTD CSS theme to introduce the theme corrections
# https://github.com/rtfd/sphinx_rtd_theme/pull/432
def setup(app):
app.add_stylesheet('theme_overrides.css')

0 comments on commit 43fb803

Please sign in to comment.