From 021f15256a825e256be0cb6a8a3d237abc59ecda Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 23 Jul 2019 16:37:09 +0200 Subject: [PATCH] Add CSS classes for reStructuredText figures Fixes #2113 --- pelican/tests/output/basic/theme/css/main.css | 19 +++++++++++++++++-- .../tests/output/custom/theme/css/main.css | 19 +++++++++++++++++-- .../output/custom_locale/theme/css/main.css | 19 +++++++++++++++++-- pelican/themes/notmyidea/static/css/main.css | 19 +++++++++++++++++-- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/pelican/tests/output/basic/theme/css/main.css b/pelican/tests/output/basic/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/basic/theme/css/main.css +++ b/pelican/tests/output/basic/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** Layout *****/ .body {clear: both; margin: 0 auto; width: 800px;} -img.right, figure.right {float: right; margin: 0 0 2em 2em;} -img.left, figure.left {float: left; margin: 0 2em 2em 0;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/tests/output/custom/theme/css/main.css b/pelican/tests/output/custom/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/custom/theme/css/main.css +++ b/pelican/tests/output/custom/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** Layout *****/ .body {clear: both; margin: 0 auto; width: 800px;} -img.right, figure.right {float: right; margin: 0 0 2em 2em;} -img.left, figure.left {float: left; margin: 0 2em 2em 0;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/tests/output/custom_locale/theme/css/main.css b/pelican/tests/output/custom_locale/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/custom_locale/theme/css/main.css +++ b/pelican/tests/output/custom_locale/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** Layout *****/ .body {clear: both; margin: 0 auto; width: 800px;} -img.right, figure.right {float: right; margin: 0 0 2em 2em;} -img.left, figure.left {float: left; margin: 0 2em 2em 0;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** Layout *****/ .body {clear: both; margin: 0 auto; width: 800px;} -img.right, figure.right {float: right; margin: 0 0 2em 2em;} -img.left, figure.left {float: left; margin: 0 2em 2em 0;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header