Implementing Boxed Print Theme Option #611
Replies: 5 comments 5 replies
-
Hi Adam, If I remember correctly and judging by what I don't know whether that is achievable or not with CSS. If it is, it would be great. Otherwise I see how this is an issue for the boxed theme, actually I can see that the sections wrappers are not even rendered at all in the print preview, probably because of I don't remember very well how the whole thing works, give me a bit of time to read it again and I will think of an approach Thanks |
Beta Was this translation helpful? Give feedback.
-
I assume that by doing that you lose the possibility of having a columns break inside a section. |
Beta Was this translation helpful? Give feedback.
-
The column break can happen inside a I think you're right if |
Beta Was this translation helpful? Give feedback.
-
Yes, I meant with the current functionality of Chord Charts Studio So after digging a bit in the code I confirm what I've said above, the intent was to control the column breaks with the following rules:
That part could still be improved, over the years I've spotted some cases where the column break was far from ideal (for example, a section title alone at the end of the column) So to achieve this there is first a hidden rendering of the song with all given parameter that is used to measure the height of each line. Once we have the height of all the components, it is possible to distribute them per column. Of course it works because there is no nesting of divs like we have now for the sections. And also, I found myself not using the "force column break on new section" option that much over the years, as having the text just flowing and breaking naturally provides a lot more flexibility to format a song on a single page, so I'd like to keep that possibility. So with those requirements in mind: The solution were the column break happens only on sections change should be the easiest. The other one is more challenging:
My gut feeling is that both solutions are more or less equivalent in terms of complexity. While the second might look more complex, it also keeps on building on top of the current approach, while the first option changes it completely. Also, the first option might lead to a dead end so should probably be validated in some kind of html playground first, so the effort will focus on validating the feasibility without the hassle of modifying the current code. Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
btw, I will make that repository public very soon because it does not feel right to accept contributions on a private repo, I just need to tidy things up and work on the README(s) |
Beta Was this translation helpful? Give feedback.
-
Hi @no-chris,
I'm working on implementing the boxed print theme, and I have a question about column implementation: Did you write mapLinesToColumns rather than use CSS columns primarily so we can show the page break in the preview?
Currently, I see it's using mapLinesToColumns. As you saw previously, I was lazier in my personal implementation and used what would be equivalent to:
The
break-inside:avoid;
could respect the "Column Break on section" toggle if we want, and thecolumn-count:
could respect the "Columns" slider.But I'm thinking there are good reasons you implemented
mapLinesToColumns
. I think it's so we can show the page breaks in the preview (which is pretty great). Is that right? And are there any other reasons?If so, I'm thinking I might have to change
mapLinesToColumns
tomapSectionsToColumns
rather than use my approach of making it CSS's problem to figure out.Would you let me know your thoughts? Then I will work up something either way, or in a better third way you think of. Let me know if I'm being unclear.
Thank you,
Adam
Beta Was this translation helpful? Give feedback.
All reactions