diff options
| -rw-r--r-- | modules/org-reveal-config.el | 9 | ||||
| -rw-r--r-- | tests/test-org-reveal-config-sizing.el | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/modules/org-reveal-config.el b/modules/org-reveal-config.el index e5358b13..ddb0803d 100644 --- a/modules/org-reveal-config.el +++ b/modules/org-reveal-config.el @@ -99,8 +99,10 @@ Reveal.initialize call." (defun cj/--reveal-head-preamble () "Return the <style> element for the document head. -Sets the house font sizes through the theme variables and stops the -theme from upper-casing headings." +Sets the house font sizes through the theme variables, stops the theme +from upper-casing headings, and left-aligns slide text (reveal centers +everything by default); the title slide and standalone images keep the +centering." (format "<style> :root { --r-main-font-size: %s; @@ -110,6 +112,9 @@ theme from upper-casing headings." --r-heading4-size: 1em; } .reveal h1, .reveal h2, .reveal h3, .reveal p { text-transform: none; } +.reveal .slides section { text-align: left; } +.reveal .slides #sec-title-slide { text-align: center; } +.reveal .slides section .figure { text-align: center; } </style>" cj/reveal-base-font-size)) diff --git a/tests/test-org-reveal-config-sizing.el b/tests/test-org-reveal-config-sizing.el index ea27b718..19e4e173 100644 --- a/tests/test-org-reveal-config-sizing.el +++ b/tests/test-org-reveal-config-sizing.el @@ -70,6 +70,13 @@ "Normal: the rule that stops the theme upper-casing headings survives the rewrite." (should (string-match-p "text-transform: *none" (cj/--reveal-head-preamble)))) +(ert-deftest test-org-reveal-config-head-preamble-normal-left-aligns-slide-content () + "Normal: slide text is left-aligned by default; the title slide and standalone images keep reveal's centering." + (let ((css (cj/--reveal-head-preamble))) + (should (string-match-p "\\.reveal \\.slides section {[^}]*text-align: *left" css)) + (should (string-match-p "#sec-title-slide {[^}]*text-align: *center" css)) + (should (string-match-p "section \\.figure {[^}]*text-align: *center" css)))) + (ert-deftest test-org-reveal-config-head-preamble-boundary-one-style-element () "Boundary: exactly one <style> element, opened and closed." (let ((css (cj/--reveal-head-preamble))) |
