From 31772952ad44c746aca5d0f7d5f583463bb64061 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Mon, 10 Sep 2018 12:35:04 -0700 Subject: [PATCH 1/2] Reformat ads --- media/css/readthedocs-doc-embed.css | 92 +++++++++++++++---- .../core/js/doc-embed/sponsorship.js | 4 +- 2 files changed, 74 insertions(+), 22 deletions(-) diff --git a/media/css/readthedocs-doc-embed.css b/media/css/readthedocs-doc-embed.css index 8488690cfc8..f2c6b91a6fe 100644 --- a/media/css/readthedocs-doc-embed.css +++ b/media/css/readthedocs-doc-embed.css @@ -46,32 +46,68 @@ framework html structure. */ -div.ethical-sidebar, div.ethical-footer { +div.ethical-sidebar, +div.ethical-footer { display: block !important; } -.ethical-sidebar, .ethical-footer { - padding: .5em; +.ethical-sidebar, +.ethical-footer { + padding: 1em; margin: 1em 0; } -.ethical-sidebar img, .ethical-footer img { +.ethical-sidebar img, +.ethical-footer img { width: 120px; height: 90px; display: inline-block; } -.ethical-sidebar .ethical-callout, .ethical-footer .ethical-callout { +.ethical-sidebar .ethical-callout, +.ethical-footer .ethical-callout { padding-top: 1em; clear: both; } -.ethical-sidebar .ethical-pixel, .ethical-footer .ethical-pixel, .ethical-fixedfooter .ethical-pixel { +.ethical-sidebar .ethical-pixel, +.ethical-footer .ethical-pixel, +.ethical-fixedfooter .ethical-pixel { display: none !important; } -.ethical-sidebar .ethical-text, .ethical-footer .ethical-text { +.ethical-sidebar .ethical-text, +.ethical-footer .ethical-text { margin-top: 1em; } -.ethical-sidebar .ethical-image-link, .ethical-footer .ethical-image-link { +.ethical-sidebar .ethical-image-link, +.ethical-footer .ethical-image-link { border: 0; } +.ethical-sidebar, +.ethical-footer { + background-color: #eee; + border: 1px solid #ccc; + border-radius: 5px; + color: #0a0a0a; + font-size: 14px; + line-height: 20px; +} + +.ethical-sidebar a, +.ethical-sidebar a:visited, +.ethical-sidebar a:hover, +.ethical-sidebar a:active, +.ethical-footer a, +.ethical-footer a:visited, +.ethical-footer a:hover, +.ethical-footer a:active { + color: #0a0a0a; + text-decoration: underline !important; + border-bottom: 0 !important; +} + +.ethical-callout a { + color: #707070 !important; + text-decoration: none !important; +} + /* Sidebar promotions */ .ethical-sidebar { text-align: center; @@ -80,14 +116,19 @@ div.ethical-sidebar, div.ethical-footer { /* Footer promotions */ .ethical-footer { text-align: left; - font-size: 90%; + + font-size: 12px; + line-height: 18px; } .ethical-footer img { float: right; margin-left: 25px; } .ethical-footer .ethical-callout { - text-align: right; + text-align: center; +} +.ethical-footer small { + font-size: 10px; } /* Fixed footer promotions */ @@ -127,23 +168,18 @@ div.ethical-sidebar, div.ethical-footer { } /* RTD Theme specific customizations */ +.wy-nav-side .ethical-rtd { + /* RTD theme doesn't correctly set the sidebar width */ + width: 300px; + padding: 1em; +} .ethical-rtd .ethical-sidebar { /* RTD theme doesn't set sidebar text color */ color: #b3b3b3; - /* RTD theme doesn't correctly set the sidebar width */ - width: 300px; - font-size: 14px; line-height: 20px; } -.ethical-rtd .ethical-sidebar a, -.ethical-rtd .ethical-sidebar a:visited, -.ethical-rtd .ethical-sidebar a:hover, -.ethical-rtd .ethical-sidebar a:active { - /* RTD theme doesn't set sidebar link color */ - color: #efefef; -} /* Alabaster specific customizations */ .ethical-alabaster a.ethical-image-link { @@ -162,6 +198,22 @@ div.ethical-sidebar, div.ethical-footer { margin-top: 3em; } +/* Dark theme */ +.ethical-dark-theme .ethical-sidebar { + background-color: rgba(255, 255, 255, 0.1); + border: 1px solid #a0a0a0; + color: #c2c2c2 !important; +} +.ethical-dark-theme a, +.ethical-dark-theme a:visited { + color: #e6e6e6 !important; + border-bottom: 0 !important; +} +.ethical-dark-theme .ethical-callout a { + color: #b3b3b3 !important; +} + + /* Ad block nag */ .keep-us-sustainable { padding: .5em; diff --git a/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js b/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js index bff2f9cd6e6..f4cbd456ba7 100644 --- a/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js +++ b/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js @@ -20,10 +20,10 @@ function create_sidebar_placement() { if (rtd.is_mkdocs_builder() && rtd.is_rtd_like_theme()) { selector = 'nav.wy-nav-side'; - class_name = 'ethical-rtd'; + class_name = 'ethical-rtd ethical-dark-theme'; } else if (rtd.is_rtd_like_theme()) { selector = 'nav.wy-nav-side > div.wy-side-scroll'; - class_name = 'ethical-rtd'; + class_name = 'ethical-rtd ethical-dark-theme'; } else if (rtd.is_alabaster_like_theme()) { selector = 'div.sphinxsidebar > div.sphinxsidebarwrapper'; class_name = 'ethical-alabaster'; From 9858bb6eee8f6c670ee3f839c72b41a4becaaaed Mon Sep 17 00:00:00 2001 From: David Fischer Date: Tue, 11 Sep 2018 10:36:42 -0700 Subject: [PATCH 2/2] Trigger CI