From 9576d97187684e69f5adcf302f52ca754afb415d Mon Sep 17 00:00:00 2001 From: Yuwen Hu <54161268+Oscilloscope98@users.noreply.github.com> Date: Mon, 24 Oct 2022 10:07:25 +0800 Subject: [PATCH] Fix overflow problems caused by long words (#6220) --- .../readthedocs/source/_static/css/custom.css | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/readthedocs/source/_static/css/custom.css b/docs/readthedocs/source/_static/css/custom.css index 3f105261..f54b7d25 100644 --- a/docs/readthedocs/source/_static/css/custom.css +++ b/docs/readthedocs/source/_static/css/custom.css @@ -10,6 +10,18 @@ html[data-theme="light"] { --pst-color-info-low-opacity: rgba(1, 113, 195, 0.25); } +/* force middle article contents to break an entire word + that cannot be put inside one line (e.g. a long url) */ +.bd-article-container { + overflow-wrap: break-word; +} + +/* make inline code block break word + if an entire word cannot be put inside one line, + or break at normal line break places such as / */ +code span.pre { + white-space: normal; +} /* align items in the left part of header to the ground*/ .bd-header #navbar-start { @@ -17,7 +29,7 @@ html[data-theme="light"] { } /* for version badge, possible for other badges*/ -.version-badge{ +.version-badge { border: 1px solid var(--pst-color-primary); border-radius: 0.25rem; color: var(--pst-color-primary); @@ -31,33 +43,27 @@ html[data-theme="light"] { border-left: .2rem solid var(--pst-color-info-low-opacity); } -.bd-content .sd-card .sd-card-header{ +.bd-content .sd-card .sd-card-header { background-color: var(--pst-color-info-tiny-opacity); border: none; } -.bigdl-link-card:hover{ +.bigdl-link-card:hover { border-left: .2rem solid var(--pst-color-info); } /* for sphinx-design badge components (customized for usage in card footer)*/ -.sd-badge{ +.sd-badge { padding: .35em 0em; font-size: 0.9em; } /* for landing page side bar */ -.bigdl-quicklinks-section-nav{ +.bigdl-quicklinks-section-nav { padding-bottom: 0.5rem; padding-left: 1rem; } -.bigdl-quicklinks-section-title{ +.bigdl-quicklinks-section-title { color: var(--pst-color-primary); -} - -/* force long parameter definition (which occupy a whole line) - to break in api documents for class/method */ -.sig-object{ - overflow-wrap: break-word; } \ No newline at end of file