From 91eb97447633d405bc5fe48cde19c1b4caee9e25 Mon Sep 17 00:00:00 2001 From: Grimmys Date: Fri, 6 Aug 2021 16:36:15 +0200 Subject: [PATCH 01/10] Removed CSS rules for highlighttable elements The highlighttable CSS class is no more used by any element on the pygame docs. --- docs/reST/themes/classic/static/pygame.css_t | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 28ce2e61fa..fb8e605b46 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -491,22 +491,6 @@ div.highlight pre { border: none; } -table.highlighttable { - display: table; -} - -@media only screen and (max-width: 680px) { - table.highlighttable { - display: block; - } -} - -table.highlighttable, -table.highlighttable pre { - border: none; - background-color: #eeffcc; -} - ul.simple { list-style-type: circle; margin-bottom: 1em; From 23708409832a4fc13b8aad7a2a5caaf53a7fff0c Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sat, 7 Aug 2021 12:15:57 +0200 Subject: [PATCH 02/10] Added CSS rules to fix the rendering of an image next to its code block --- docs/reST/themes/classic/static/pygame.css_t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index fb8e605b46..92c878704c 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -66,8 +66,7 @@ div.body table.matrix th.stub { /* Let a float element be beside a code block */ div.highlight-python.notranslate { - margin: 0; - clear: none; + display: inline-block; } /* -- page layout ----------------------------------------------------------- */ @@ -559,6 +558,7 @@ div.body p.small-heading { div.body div.inlined, div.body img.inlined-right { float: right; + margin: 1em 0; } div.body .inset { From 34fb2fb9db8074014e804cf7e66265a14110da7f Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sat, 7 Aug 2021 12:41:43 +0200 Subject: [PATCH 03/10] Let the images that should be displayed next to a codeblock be displayed inline on mobile devices --- docs/reST/themes/classic/static/pygame.css_t | 25 ++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 92c878704c..10565681c5 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -146,13 +146,6 @@ div.document { } } -/* Make tables be responsive-ish. */ -@media only screen and (max-width: 680px) { - table, thead, tbody, th, td, tr { - display: block; - } -} - .toc td { display:block; width: 200%; @@ -484,6 +477,9 @@ pre { line-height: 120%; margin-bottom: 1em; padding: 5px 5px 5px 15px; + white-space: pre-wrap; + word-wrap: break-word; + text-align: justify; } div.highlight pre { @@ -673,3 +669,18 @@ pre.commentContent { border: 0; white-space: pre-wrap; } + +/* -- responsive design --------------------------------------------------------- */ + +@media only screen and (max-width: 680px) { + /* Make tables be responsive-ish. */ + table, thead, tbody, th, td, tr { + display: block; + } + + div.body img.inlined-right { + float: none; + display: block; + margin: auto + } +} \ No newline at end of file From f3be2c7e806562b5f3f1106428fcc33800975a9e Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sun, 8 Aug 2021 18:07:23 +0200 Subject: [PATCH 04/10] Added space between line number and statement in codeblocks 15px for wide screen, 10px for mobile devices --- docs/reST/themes/classic/static/pygame.css_t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 10565681c5..374f0a06b1 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -573,6 +573,10 @@ div.body span.codelineref { background-color: {{ theme_keywordbgcolor }}; } +span.linenos { + margin-right: 15px; +} + /* Examples section: contains one or more example subsections */ div.examples > div.example { clear: both; @@ -683,4 +687,8 @@ pre.commentContent { display: block; margin: auto } + + span.linenos { + margin-right: 10px; + } } \ No newline at end of file From f5f1eafee40216d066e947ed155c584df86c6d5a Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sun, 8 Aug 2021 18:26:13 +0200 Subject: [PATCH 05/10] Modified CSS rules to prevent text overflow on small screens --- docs/reST/themes/classic/static/pygame.css_t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 374f0a06b1..979023a97f 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -148,7 +148,6 @@ div.document { .toc td { display:block; - width: 200%; } .toc td:last-child { @@ -691,4 +690,8 @@ pre.commentContent { span.linenos { margin-right: 10px; } + + .addcomment input, a.commentButton { + font-size: 10px; + } } \ No newline at end of file From e72ca6344e0a6473d68375cdacdca5df6e301f33 Mon Sep 17 00:00:00 2001 From: Grimmys Date: Mon, 30 Aug 2021 00:25:42 +0200 Subject: [PATCH 06/10] Break lines in pre blocks on mobile devices only --- docs/reST/themes/classic/static/pygame.css_t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 979023a97f..e96b19a39a 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -476,8 +476,6 @@ pre { line-height: 120%; margin-bottom: 1em; padding: 5px 5px 5px 15px; - white-space: pre-wrap; - word-wrap: break-word; text-align: justify; } @@ -694,4 +692,9 @@ pre.commentContent { .addcomment input, a.commentButton { font-size: 10px; } + + pre { + white-space: pre-wrap; + word-wrap: break-word; + } } \ No newline at end of file From 5f03374ffc4449222d42b70c2f6f5e0d9b4c4999 Mon Sep 17 00:00:00 2001 From: Grimmys Date: Mon, 30 Aug 2021 00:28:35 +0200 Subject: [PATCH 07/10] Revert td width back to 200% but not for mobile devices --- docs/reST/themes/classic/static/pygame.css_t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index e96b19a39a..962ab14984 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -148,6 +148,7 @@ div.document { .toc td { display:block; + width: 200%; } .toc td:last-child { @@ -697,4 +698,8 @@ pre.commentContent { white-space: pre-wrap; word-wrap: break-word; } + + .toc td { + width: 100%; + } } \ No newline at end of file From 1623db45f9e4b77a1653e1b2802ffb42c9191efd Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sun, 5 Sep 2021 21:11:14 +0200 Subject: [PATCH 08/10] Removed empty block line between "Raises" and "Note" blocks on scrap page and removed some horizontal margin between block title and content --- docs/reST/ref/scrap.rst | 2 -- docs/reST/themes/classic/static/pygame.css_t | 6 ------ 2 files changed, 8 deletions(-) diff --git a/docs/reST/ref/scrap.rst b/docs/reST/ref/scrap.rst index 2718966f20..2f13409e7c 100644 --- a/docs/reST/ref/scrap.rst +++ b/docs/reST/ref/scrap.rst @@ -78,8 +78,6 @@ For an example of how the scrap module works refer to the examples page :raises pygame.error: if unable to initialize scrap module - | - .. note:: The scrap module requires :func:`pygame.display.set_mode()` be called before being initialized. diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 962ab14984..23b654e6c6 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -600,12 +600,6 @@ div.example div.break { height: 0; } -/* -- parameters returns table style ---------------------------------------- */ - -dl.field-list > dt { - padding-right: 10px; -} - /* -- tooltip style --------------------------------------------------------- */ a.tooltip { From e8067751d1c1d53f68b0a67f7c2921de58252252 Mon Sep 17 00:00:00 2001 From: Grimmys Date: Sun, 26 Sep 2021 12:46:52 +0200 Subject: [PATCH 09/10] Added new CSS rule to embrace most recent docutils tag generation The title are under a section tag instead of a div with a "section" class starting from docutils v0.17 --- docs/reST/themes/classic/static/pygame.css_t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index 23b654e6c6..e71d657e07 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -494,8 +494,12 @@ code.descclassname, code.descname { font-weight: bold; } -/* Top level section title format */ -div.body > div.section > dl > dt.title { +/* + Top level section title format + section tag has been introduced in docutils 0.17 as a replacement for div.section + Both rule variations are kept to support old versions of docutils + */ +div.body > section > dl > dt.title, div.body > div.section > dl > dt.title { font-size: 120%; font-weight: bold; margin-bottom: 1em; From b576d34380ae5a3ac04e50ed90d83fd2584adf29 Mon Sep 17 00:00:00 2001 From: Grimmys Date: Tue, 28 Sep 2021 19:00:34 +0200 Subject: [PATCH 10/10] Added extra blank line at the end of pygame.css_t file --- docs/reST/themes/classic/static/pygame.css_t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reST/themes/classic/static/pygame.css_t b/docs/reST/themes/classic/static/pygame.css_t index e71d657e07..16ed547f05 100644 --- a/docs/reST/themes/classic/static/pygame.css_t +++ b/docs/reST/themes/classic/static/pygame.css_t @@ -700,4 +700,4 @@ pre.commentContent { .toc td { width: 100%; } -} \ No newline at end of file +}