Merge pull request #4367 from shad-k/fix/issue-4238

Add custom.css for docs to change pre tag styles
This commit is contained in:
chriseth 2018-07-03 22:40:51 +02:00 committed by GitHub
commit 16f8c23aa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 23 deletions

View File

@ -1,13 +0,0 @@
/* 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 sphinx_rtd_theme they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive {
overflow: visible !important;
}
}

View File

@ -27,6 +27,8 @@ def setup(sphinx):
from pygments_lexer_solidity import SolidityLexer
sphinx.add_lexer('Solidity', SolidityLexer())
sphinx.add_stylesheet('css/custom.css')
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@ -141,16 +143,7 @@ html_theme = 'sphinx_rtd_theme'
# 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']
# A dictionary of values to pass into the template engines context for
# all pages. Single values can also be put in
# this dictionary using the -A command-line option of sphinx-build.
html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in sphinx_rtd_theme
],
}
html_static_path = []
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied

14
docs/docs-css/custom.css Normal file
View File

@ -0,0 +1,14 @@
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word;
}
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: pre-wrap;
}
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: pre-wrap;
}