1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
/* flm.html.style.core */
/* The look of the elements that any document can hold: paragraphs and
blocks, the display styles of a span, links, images, and the three
decorations (a run-in heading, a mark at the end of a block, a note beside
the text). Apart from the :root rule that declares the custom
properties, every selector begins with a class of the HTML contract, the
set of classes and attributes that this backend promises to write (the
table CONVENTIONS of the Rust module flm_core::stdlib::backends::html).
The values a page can adjust are the custom properties declared on :root
below. All rules are in the cascade layer flm, so any rule of the page
outside that layer overrides them.
A reference whose target was not found is styled in this stylesheet and
not in flm.html.style.errors, because it is a span: the conventions table
lists this stylesheet for a span. Each stylesheet holds the rules of the
elements for which the conventions table lists it, so a page that holds
an element receives every rule for that element with the stylesheet that
the element requires. */
@ }
/* Paragraphs and blocks are separated by one space; the first and the last
do not push against the edge of what holds them. */
}
}
}
/* A span's look comes from its display style (data-flm-style), never from
its tag: the HTML contract does not promise which tag is written for a
display style, so that the backend can change it. */
}
}
}
}
}
}
}
/* A link: colored rather than underlined by default, and underlined while
the pointer is over it. */
}
}
/* A picture is shown at the width and height that its element carries
(--flm-element-width, --flm-element-height, written by the backend in
the element's style attribute), at its natural size in a direction for
which it carries none, and never wider than the text that contains it.
Where the element carries both lengths, it also carries their ratio
(--flm-element-aspect-ratio), and the box keeps that ratio: its width is
set and its height follows from the ratio, so a picture narrowed to the
width of the text keeps its proportions. Where it carries no ratio, the
height that is set is kept, and the picture is fitted inside its box
without being distorted. --flm-image-height and --flm-image-fit are
working values of this rule alone: where the element carries a ratio,
each holds the ratio twice, which is neither a valid height nor a valid
fit, so height and object-fit then take their initial values, auto and
fill. */
}
/* A picture written as a block (a float's content, for example) is
displayed as a block and spaced as every block is; a picture inside a
line of text flows with the text. */
}
/* A run-in decoration leads the paragraph it introduces: it stays in the
flow of the text, and the gap between it and that text is set here. */
}
/* A mark at the end of a block, such as the square that ends a proof. */
}
/* A note beside the text. The backend writes it as a span at the place of
its mark, in the flow of the text, and it stays there, in a smaller
size, while the switch --flm-margin-note-column is off. Where the switch
is on, the note is floated right and pulled out of the text by a
negative right margin as wide as the column, the gap, and the inset of
the block that contains it: the note is then in the column, level with
the line of its mark, and the text keeps its whole width. Notes marked
on the same line are stacked in the column, one below the other
(clear: right), each starting at the column's left edge regardless of
the alignment of the line it is marked in. The column is room that the
element holding the text leaves to its right: flm.html.style.page leaves
it on the page's content element and turns the switch on there when the
window is wide enough, and a host that places the HTML output in a page
of its own does the same on its own element, under its own condition.
A note inside a block that contains its floats, such as a
list entry laid out as a grid, still lengthens that block when the note
runs below the block's last line, and is not stacked with the notes of
the text before that block, which it may overlap.
The switch works through the way a custom property is substituted,
because the value of float cannot be computed from a number, so no
calculation can choose between floating and not. Each declaration
below that begins with var(--flm-margin-note-column) holds the value
that a note takes in the column: with the switch set to an empty value,
the declaration reads as that value; with the switch at its initial
value, the declaration is invalid, so the property takes its initial
value (no float, no clearance, its own width, no margin). The padding
reads the switch the other way round, with the space as the fallback:
the space around the note at its mark while the switch is off, and no
padding in the column. */
}
/* Inside text written in a formula, a note stays at its mark regardless of
the switch: the formula renderer measures that text as one box before
this stylesheet would float the note out of it, so a floated note would
overlap the formula's text instead of moving out of it. */
}
/* A reference whose target was not found: its text is shown, marked as an
error. It is a display style of a span, so its rule is in this
stylesheet with the other display styles, and it reaches every page
that holds a span. */
}
}