From 12ca82e6e68ce4ca86b86ffd1b77fe240a138af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 3 Oct 2023 08:00:20 +0200 Subject: [PATCH 1/6] Initial commit --- themes/V3/5ePHB/style.less | 117 +------------------------------------ 1 file changed, 2 insertions(+), 115 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 90320f9be..644443bd5 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -14,13 +14,6 @@ --HB_Color_Footnotes : #C9AD6A; // Gold } -@page { margin: 0; } -body { - counter-reset : phb-page-numbers; -} -*{ - -webkit-print-color-adjust : exact; -} .useSansSerif(){ font-family : ScalySansRemake; font-size : 0.318cm; @@ -43,8 +36,6 @@ body { } } .useColumns(@multiplier : 1, @fillMode: auto){ - column-count : 2; - column-fill : @fillMode; column-gap : 0.9cm; column-width : 8cm * @multiplier; -webkit-column-count : 2; @@ -54,29 +45,11 @@ body { -webkit-column-gap : 0.9cm; -moz-column-gap : 0.9cm; } -.columnWrapper{ - max-height : 100%; - column-span : all; - columns : inherit; - column-gap : inherit; -} .page{ .useColumns(); - counter-increment : phb-page-numbers; - position : relative; - z-index : 15; - box-sizing : border-box; - overflow : hidden; - height : 279.4mm; - width : 215.9mm; - background-color : var(--HB_Color_Background); background-image : @backgroundImage; - padding : 1.4cm 1.9cm 1.7cm; font-family : BookInsanityRemake; font-size : 0.34cm; - text-rendering : optimizeLegibility; - page-break-before : always; - page-break-after : always; } //***************************** // * BASE @@ -85,7 +58,6 @@ body { .page{ p{ overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS - display : block; line-height : 1.25em; &+* { margin-top : 0.325cm; @@ -96,17 +68,11 @@ body { } ul{ margin-bottom : 0.8em; - padding-left : 1.4em; line-height : 1.25em; - list-style-position : outside; - list-style-type : disc; } ol{ margin-bottom : 0.8em; - padding-left : 1.4em; line-height : 1.25em; - list-style-position : outside; - list-style-type : decimal; } //Indents after p or lists p+p, ul+p, ol+p{ @@ -116,22 +82,8 @@ body { z-index : -1; } strong{ - font-weight : bold; letter-spacing : -0.02em; } - em{ - font-style : italic; - } - sup{ - vertical-align : super; - font-size : smaller; - line-height : 0; - } - sub{ - vertical-align : sub; - font-size : smaller; - line-height : 0; - } //***************************** // * HEADERS // *****************************/ @@ -213,13 +165,11 @@ body { // *****************************/ table{ .useSansSerif(); - width : 100%; line-height : 16px; & + * { margin-top : 0.325cm; } thead{ - display: table-row-group; font-weight : 800; th{ vertical-align : bottom; @@ -333,43 +283,11 @@ body { /* Watermark */ .watermark { - display : grid !important; - place-items : center; - justify-content : center; - position : absolute; - top : 0; - left : 0; - width : 100%; - height : 100%; - font-size : 120px; - text-transform : uppercase; color : black; - mix-blend-mode : overlay; - opacity : 30%; - transform : rotate(-45deg); - z-index : 500; - p { - margin-bottom : none; - } } /* Watercolor */ - [class*="watercolor"] { - position : absolute; - width : 2000px; /* dimensions need to be real big so the user can set */ - height : 2000px; /* height or width and the image will maintain aspect ratio */ - -webkit-mask-image : var(--wc); - -webkit-mask-size : contain; - -webkit-mask-repeat : no-repeat; - mask-image : var(--wc); - mask-size : contain; - mask-repeat : no-repeat; - background-size : cover; - background-color : var(--HB_Color_WatercolorStain); /*default color*/ - --wc : @watercolor1; /*default image*/ - z-index : -2; - } - + .watercolor1 { --wc : @watercolor1; } .watercolor2 { --wc : @watercolor2; } .watercolor3 { --wc : @watercolor3; } @@ -530,19 +448,14 @@ body { // * CODE BLOCKS // ************************************/ code{ - font-family : "Courier New", Courier, monospace; - font-size : 0.325; + font-size : 0.325cm; padding : 0px 4px; color : #58180d; background-color : #faf7ea; border-radius : 4px; - white-space : pre-wrap; - overflow-wrap : break-word; } pre code{ - width : 100%; - display : inline-block; border-style : solid; border-width : 1px; border-image : @codeBorderImage 26 stretch; @@ -565,19 +478,6 @@ body { visibility : hidden; margin : 0px; } - .columnSplit { - visibility : hidden; - -webkit-column-break-after : always; - break-after : always; - -moz-column-break-after : always; - } - //Avoid breaking up - blockquote,table{ - z-index : 15; - -webkit-column-break-inside : avoid; - page-break-inside : avoid; - break-inside : avoid; - } //Text indent right after table table+p{ text-indent : 1em; @@ -587,11 +487,6 @@ body { margin-bottom : 0px; margin-left : 1.5em; } - li{ - -webkit-column-break-inside : avoid; - page-break-inside : avoid; - break-inside : avoid; - } } //***************************** // * SPELL LIST @@ -1032,8 +927,6 @@ break-inside : avoid; .page { dl { line-height : 1.25em; - padding-left : 1em; - white-space : pre-line; & + * { margin-top : 0.28cm; } @@ -1045,15 +938,9 @@ break-inside : avoid; margin-top: 0.17cm; } dt { - display : inline; margin-right : 5px; margin-left : -1em; } - dd { - display : inline; - margin-left : 0px; - text-indent : 0px; - } } //***************************** From 0775f9ee1b193a9623fed5d461a0b8e2fae7578c Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 15:45:39 -0500 Subject: [PATCH 2/6] Restore padding to code blocks --- themes/V3/5ePHB/style.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index bb79f75e6..a3d9a7c09 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -448,6 +448,8 @@ border-image : @codeBorderImage 26 stretch; border-image-width : 10px; border-image-outset : 2px; + margin-bottom: 2px; + padding: 0.15cm; .page :where(&) { margin-top : 2px; //Prevent top border getting cut off on colbreak } From f5f6137a4d035ab80c3097d71e459cd3afb4ccd3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 15:48:58 -0500 Subject: [PATCH 3/6] Lint --- themes/V3/5ePHB/style.less | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index a3d9a7c09..31d37b2fa 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -14,7 +14,7 @@ --HB_Color_Footnotes : #C9AD6A; // Gold } -.useSansSerif(){ +.useSansSerif() { font-family : 'ScalySansRemake'; font-size : 0.318cm; line-height : 1.2em; @@ -39,11 +39,11 @@ -webkit-column-gap : 0.9cm; -moz-column-gap : 0.9cm; } -.page{ +.page { .useColumns(); - background-image : @backgroundImage; - font-family : BookInsanityRemake; + font-family : 'BookInsanityRemake'; font-size : 0.34cm; + background-image : @backgroundImage; } //***************************** // * BASE @@ -58,13 +58,13 @@ & + p { margin-top : 0; } } ul { - margin-bottom : 0.8em; padding-left : 1.4em; + margin-bottom : 0.8em; line-height : 1.25em; } ol { - margin-bottom : 0.8em; padding-left : 1.4em; + margin-bottom : 0.8em; line-height : 1.25em; } //Indents after p or lists @@ -149,8 +149,8 @@ .useSansSerif(); line-height : 16px; & + * { margin-top : 0.325cm; } - thead{ - display: table-row-group; + thead { + display : table-row-group; font-weight : 800; th { //padding : 0.14em 0.4em; @@ -283,9 +283,7 @@ } /* Watermark */ - .watermark { - color : black; - } + .watermark { color : black; } /* Watercolor */ @@ -434,22 +432,22 @@ // * CODE BLOCKS // ************************************/ code { - font-size : 0.325cm; padding : 0px 4px; - color : #58180d; - background-color : #faf7ea; + font-size : 0.325cm; + color : #58180D; + background-color : #FAF7EA; border-radius : 4px; } - pre code{ + pre code { + padding : 0.15cm; + margin-bottom : 2px; border-style : solid; border-width : 1px; border-radius : 12px; border-image : @codeBorderImage 26 stretch; border-image-width : 10px; border-image-outset : 2px; - margin-bottom: 2px; - padding: 0.15cm; .page :where(&) { margin-top : 2px; //Prevent top border getting cut off on colbreak } @@ -875,16 +873,13 @@ .page { dl { line-height : 1.25em; - & + * { margin-top : 0.28cm; } + & + * { margin-top : 0.17cm; } } - dl + * { - margin-top : 0.17cm; - } - p + dl { margin-top: 0.17cm; } - dt { - margin-right : 5px; + p + dl { margin-top : 0.17cm; } + dt { + margin-right : 5px; margin-left : -1em; - } + } } //***************************** From ee4921f02ca38d199fe0dd29e886b1f2897bb729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 11 Dec 2023 22:08:03 +0100 Subject: [PATCH 4/6] uncaught styles --- themes/V3/5ePHB/style.less | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 31d37b2fa..9cc89f6d3 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -51,10 +51,8 @@ .page { p { - display : block; line-height : 1.25em; - overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS - & + * { margin-top : 0.325cm; } + & + * { margin-top : 0.325cm; } //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS & + p { margin-top : 0; } } ul { From c10be139c9e400878ca8b53955da5d373b6581e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 11 Dec 2023 22:09:08 +0100 Subject: [PATCH 5/6] redundant font-weight removed --- themes/V3/5ePHB/style.less | 2 -- 1 file changed, 2 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 9cc89f6d3..a4157f31e 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -77,7 +77,6 @@ // *****************************/ h1,h2,h3,h4 { font-family : 'MrEavesRemake'; - font-weight : 800; color : var(--HB_Color_HeaderText); } h1 { @@ -136,7 +135,6 @@ //margin-bottom : 0.02cm; font-family : 'ScalySansSmallCapsRemake'; font-size : 0.423cm; - font-weight : 900; line-height : 0.951em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.2cm; } } From 7c9513f3776d5911244475f273fc4aa69bdc0171 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 16:29:16 -0500 Subject: [PATCH 6/6] Lint --- themes/V3/5ePHB/style.less | 124 ++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index a4157f31e..209e54b08 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -20,7 +20,7 @@ line-height : 1.2em; p,dl,ul,ol { line-height : 1.2em; } ul, ol { padding-left : 1em; } - em { font-style : italic; } + em { font-style : italic; } strong { font-weight : 800; letter-spacing : -0.02em; @@ -41,29 +41,29 @@ } .page { .useColumns(); - font-family : 'BookInsanityRemake'; - font-size : 0.34cm; - background-image : @backgroundImage; + font-family : 'BookInsanityRemake'; + font-size : 0.34cm; + background-image : @backgroundImage; } -//***************************** +// ***************************** // * BASE - // *****************************/ +// *****************************/ .page { p { - line-height : 1.25em; + line-height : 1.25em; & + * { margin-top : 0.325cm; } //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS & + p { margin-top : 0; } } ul { - padding-left : 1.4em; - margin-bottom : 0.8em; - line-height : 1.25em; + padding-left : 1.4em; + margin-bottom : 0.8em; + line-height : 1.25em; } ol { - padding-left : 1.4em; - margin-bottom : 0.8em; - line-height : 1.25em; + padding-left : 1.4em; + margin-bottom : 0.8em; + line-height : 1.25em; } //Indents after p or lists p + p, ul + p, ol + p { text-indent : 1em; } @@ -72,12 +72,12 @@ font-weight : bold; letter-spacing : -0.02em; } - //***************************** + // ***************************** // * HEADERS // *****************************/ h1,h2,h3,h4 { - font-family : 'MrEavesRemake'; - color : var(--HB_Color_HeaderText); + font-family : 'MrEavesRemake'; + color : var(--HB_Color_HeaderText); } h1 { margin-bottom : 0.18cm; //Margin-bottom only because this is WIDE @@ -106,8 +106,8 @@ h2 { //margin-top : 0px; //Font is misaligned. Shift up slightly //margin-bottom : 0.05cm; - font-size : 0.75cm; - line-height : 0.988em; //Font is misaligned. Shift up slightly + font-size : 0.75cm; + line-height : 0.988em; //Font is misaligned. Shift up slightly } h3 { //margin-top : -0.1cm; //Font is misaligned. Shift up slightly @@ -123,8 +123,8 @@ h4 { //margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-bottom : 0.02cm; - font-size : 0.458cm; - line-height : 0.971em; //Font is misaligned. Shift up slightly + font-size : 0.458cm; + line-height : 0.971em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.09cm; } } * + h4 { @@ -133,17 +133,17 @@ h5 { //margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-bottom : 0.02cm; - font-family : 'ScalySansSmallCapsRemake'; - font-size : 0.423cm; - line-height : 0.951em; //Font is misaligned. Shift up slightly + font-family : 'ScalySansSmallCapsRemake'; + font-size : 0.423cm; + line-height : 0.951em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.2cm; } } - //***************************** + // ***************************** // * TABLE // *****************************/ table { .useSansSerif(); - line-height : 16px; + line-height : 16px; & + * { margin-top : 0.325cm; } thead { display : table-row-group; @@ -159,15 +159,15 @@ tr { td { //padding : 0.14em 0.4em; - padding : 0px 1.5px; // Both of these are temporary, just to force + padding : 0px 1.5px; // Both of these are temporary, just to force //line-height : 16px; // PDF to render at same height until Chrome 108 } &:nth-child(odd) { background-color : var(--HB_Color_Accent); } } } } - //***************************** - // * QUOTE + // ***************************** + // * QUOTE // *****************************/ .quote { @@ -200,9 +200,7 @@ } - - - //***************************** + // ***************************** // * NOTE // *****************************/ .note { @@ -216,7 +214,7 @@ border-image-outset : 9px 0px; box-shadow : 1px 4px 14px #888888; .page :where(&) { - margin-top : 9px; //Prevent top border getting cut off on colbreak + margin-top : 9px; //Prevent top border getting cut off on colbreak } & + * { margin-top : 0.45cm; } h5 { font-size : 0.375cm; } @@ -226,7 +224,7 @@ } :last-child { margin-bottom : 0; } } - //************************************ + // ************************************ // * DESCRIPTIVE TEXT BOX // ************************************/ .descriptive { @@ -250,7 +248,7 @@ } :last-child { margin-bottom : 0; } } - //***************************** + // ***************************** // * Images Snippets // *****************************/ @@ -279,7 +277,7 @@ } /* Watermark */ - .watermark { color : black; } + .watermark { color : black; } /* Watercolor */ @@ -296,7 +294,7 @@ .watercolor11 { --wc : @watercolor11; } .watercolor12 { --wc : @watercolor12; } - //***************************** + // ***************************** // * MONSTER STAT BLOCK // *****************************/ .monster { @@ -317,24 +315,24 @@ box-shadow : 1px 4px 14px #888888; } - position : relative; - padding : 0px; - margin-bottom : 0.325cm; + position : relative; + padding : 0px; + margin-bottom : 0.325cm; //Headers h2 { - margin : 0; - font-size : 0.62cm; - line-height : 1em; + margin : 0; + font-size : 0.62cm; + line-height : 1em; & + p { margin-bottom : 0; font-size : 0.304cm; //Monster size and type subtext } } h3 { - font-family : 'ScalySansSmallCapsRemake'; - font-size : 0.45cm; - border-bottom : 1.5px solid var(--HB_Color_HeaderText); + font-family : 'ScalySansSmallCapsRemake'; + font-size : 0.45cm; + border-bottom : 1.5px solid var(--HB_Color_HeaderText); } //Triangle dividers @@ -381,10 +379,10 @@ .useColumns(0.96, @fillMode: balance); } - //***************************** + // ***************************** // * FOOTER // *****************************/ - &:after { + &::after { position : absolute; bottom : 0px; left : 0px; @@ -424,7 +422,7 @@ color : var(--HB_Color_Footnotes); text-align : right; } - //************************************ + // ************************************ // * CODE BLOCKS // ************************************/ code { @@ -449,7 +447,7 @@ } & + * { margin-top : 0.325cm; } } - //***************************** + // ***************************** // * EXTRAS // *****************************/ hr { @@ -464,12 +462,12 @@ margin-left : 1.5em; } } -//***************************** +// ***************************** // * SPELL LIST // *****************************/ .page .spellList { .useSansSerif(); - column-count : 2; + column-count : 2; ul + h5 { margin-top : 15px; } p, ul { font-size : 0.352cm; @@ -487,7 +485,7 @@ &.wide { column-count : 4; } } -//***************************** +// ***************************** // * CLASS TABLE // *****************************/ .page .classTable { @@ -534,7 +532,7 @@ } h5 + table { margin-top : 0.2cm; } } -//***************************** +// ***************************** // * FRONT COVER PAGE // *****************************/ .page:has(.frontCover) { @@ -628,7 +626,7 @@ } } } -//***************************** +// ***************************** // * INSIDE COVER PAGE // *****************************/ .page:has(.insideCover) { @@ -673,7 +671,7 @@ } } } -//***************************** +// ***************************** // * BACK COVER // *****************************/ .page:has(.backCover) { @@ -755,10 +753,10 @@ } } -//***************************** +// ***************************** // * PART COVER - // *****************************/ - .page:has(.partCover) { +// *****************************/ +.page:has(.partCover) { padding-top : 0; text-align : center; columns : 1; @@ -794,7 +792,7 @@ } } -//***************************** +// ***************************** // * TABLE OF CONTENTS // *****************************/ .page { @@ -863,7 +861,7 @@ } } -//***************************** +// ***************************** // * DEFINITION LISTS // *****************************/ .page { @@ -878,10 +876,10 @@ } } -//***************************** +// ***************************** // * WIDE // *****************************/ -.page .wide { margin-bottom : 0.325cm; } +.page .wide { margin-bottom : 0.325cm; } .page h1 + * { margin-top : 0; } @@ -920,7 +918,7 @@ } } } -//***************************** +// ***************************** // * INDEX // *****************************/ .page {