0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 01:42:42 +00:00

Fix /print, make .page outer element for consistency with legacy

This commit is contained in:
Trevor Buckner
2021-08-26 22:43:57 -04:00
parent 85841d22f5
commit a7005d779a
4 changed files with 17 additions and 21 deletions

View File

@@ -133,8 +133,8 @@ const BrewRenderer = createClass({
else { else {
pageText += `\n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear) pageText += `\n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear)
return ( return (
<div className='pageWrapper' id={`p${index + 1}`} key={index} > <div className='page' id={`p${index + 1}`} key={index} >
<div className='page' dangerouslySetInnerHTML={{ __html: Markdown.render(pageText) }} /> <div className='columnWrapper' dangerouslySetInnerHTML={{ __html: Markdown.render(pageText) }} />
</div> </div>
); );
} }

View File

@@ -11,12 +11,6 @@
margin-left : auto; margin-left : auto;
box-shadow : 1px 4px 14px #000; box-shadow : 1px 4px 14px #000;
} }
&>.pageWrapper{
margin-right : auto;
margin-bottom : 30px;
margin-left : auto;
box-shadow : 1px 4px 14px #000;
}
} }
} }
.pane{ .pane{

View File

@@ -37,20 +37,21 @@ const PrintPage = createClass({
renderPages : function(){ renderPages : function(){
if(this.props.brew.renderer == 'legacy') { if(this.props.brew.renderer == 'legacy') {
return _.map(this.state.brewText.split('\\page'), (page, index)=>{ return _.map(this.state.brewText.split('\\page'), (pageText, index)=>{
return <div return <div
className='phb page' className='phb page'
id={`p${index + 1}`} id={`p${index + 1}`}
dangerouslySetInnerHTML={{ __html: MarkdownLegacy.render(page) }} dangerouslySetInnerHTML={{ __html: MarkdownLegacy.render(pageText) }}
key={index} />; key={index} />;
}); });
} else { } else {
return _.map(this.state.brewText.split(/^\\page/gm), (page, index)=>{ return _.map(this.state.brewText.split(/^\\page/gm), (pageText, index)=>{
return <div pageText += `\n\\column\n&nbsp;`; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear)
className='phb3 page' return (
id={`p${index + 1}`} <div className='page' id={`p${index + 1}`} key={index} >
dangerouslySetInnerHTML={{ __html: Markdown.render(page) }} <div className='columnWrapper' dangerouslySetInnerHTML={{ __html: Markdown.render(pageText) }} />
key={index} />; </div>
);
}); });
} }

View File

@@ -46,7 +46,11 @@ body {
-webkit-column-gap : 0.9cm; -webkit-column-gap : 0.9cm;
-moz-column-gap : 0.9cm; -moz-column-gap : 0.9cm;
} }
.pageWrapper{ .columnWrapper{
max-height : 100%;
}
.page{
.useColumns();
counter-increment : phb-page-numbers; counter-increment : phb-page-numbers;
position : relative; position : relative;
z-index : 15; z-index : 15;
@@ -56,10 +60,6 @@ body {
width : 215.9mm; width : 215.9mm;
background-color : @background; background-color : @background;
background-image : @backgroundImage; background-image : @backgroundImage;
}
.page{
.useColumns();
max-height : 100%;
padding : 1.4cm 1.9cm 1.7cm; padding : 1.4cm 1.9cm 1.7cm;
font-family : BookInsanityRemake; font-family : BookInsanityRemake;
font-size : 0.34cm; font-size : 0.34cm;
@@ -540,6 +540,7 @@ body {
column-span : all; column-span : all;
-webkit-column-span : all; -webkit-column-span : all;
-moz-column-span : all; -moz-column-span : all;
display : block;
} }
//***************************** //*****************************
// * CLASS TABLE // * CLASS TABLE