diff --git a/inst/resources/gitbook/css/plugin-fontsettings.css b/inst/resources/gitbook/css/plugin-fontsettings.css index b25e8a6de..98cd75749 100644 --- a/inst/resources/gitbook/css/plugin-fontsettings.css +++ b/inst/resources/gitbook/css/plugin-fontsettings.css @@ -302,7 +302,3 @@ div.book.color-theme-2 { font-weight: 600; } -/* line-height */ -.book .book-body .page-wrapper .page-inner section.normal { - line-height: attr(data-line-height); -} diff --git a/inst/resources/gitbook/js/plugin-fontsettings.js b/inst/resources/gitbook/js/plugin-fontsettings.js index aad6027b3..df2651b14 100644 --- a/inst/resources/gitbook/js/plugin-fontsettings.js +++ b/inst/resources/gitbook/js/plugin-fontsettings.js @@ -88,8 +88,8 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); $book.addClass("color-theme-"+fontState.theme); } - $book[0].querySelector('section').dataset.lineHeight = fontState.spacing / 10; - + var lineHeight = Math.max(fontState.spacing / 10, 1); + $book.find('section').css('line-height', lineHeight); }; function init(config) {