-
Notifications
You must be signed in to change notification settings - Fork 54
Description
As part of my research on #52 I also studied whether the push/pull technique could be applied to blocks with text-align:right (that is, the punctuation would hang over the right margin instead of the left). I haven’t gotten it to work yet. It may be too complicated to be worthwhile. What I tried:
-
In the processor script, closing punctuation would need to be wrapped similar to opening punctuation, though in opposite order: the
pullwould precede thepush. Also, the wrapping tag for the closing punctuation would want to be distinct from the opening (e.g.,push-openandpush-closedrather than justpush). This part seemed tractable. -
In the CSS, however, I couldn’t come up with a way of styling the
push-closedandpull-closedto get analogous behavior with the usualpush/pullpairs. The usual idea is that in the middle of a line, the two appear together, but at a line break, thepushremains at the end of one line, the line break happens, and thepullappears at the beginning of the next. On the right edge, thepullwould happen first, at the end of the line, and then assumedly you’d want thepushto wrap to the next. -
More troublesome still, I couldn’t come up with a way to toggle this behavior purely with CSS. That is, in any given text block, the text is either aligned left or right (or neither) so only the opening push/pull pairs or closing push/pull pairs should work (or neither). But there isn’t any way to write a CSS selector conditioned on the presence of another CSS property. If every right-aligned block was guaranteed to have, say,
class="right", then you can have CSS selectors like.right push-closedand so on. But that requires the right-alignment to be encoded at “compile time”, rather than strictly in the CSS (where it should be).