Skip to main content

Module html

Module html 

Source
Expand description

The stylesheet of the quote feature on the html backend, flm.quote.style (stylesheet), and the markup it selects on.

On the html backend a quotation is lowered by the general rule QuoteRule, into the shared presentation vocabulary; the rule also requires (records a requirement for) the feature’s style identifier STYLE (flm.quote.style), which on the html backend names this stylesheet, a style definition (StyleDef) that the backend delivers with the page (style and script definitions). The HTML itself comes from the backend’s rules for the presentation elements, the same for every feature (the HTML contract).

§The markup

A quotation is a block of role flm.quote. The HTML backend’s table of block tags (BLOCK_TAGS) writes it as a <blockquote> for every quote environment, with the environment’s name as its kind token in data-flm-kind. Each quotation section is a <div> whose second class is its role’s class: flm-quote-text, flm-quote-lines, flm-quote-attributed or flm-quote-block:

<blockquote class="flm-pres-block flm-quote" data-flm-kind="quote">
  <div class="flm-pres-block flm-quote-text">
    <p class="flm-pres-par">To be or not to be.</p>
  </div>
  <div class="flm-pres-block flm-quote-attributed">
    <p class="flm-pres-par">Shakespeare</p>
  </div>
</blockquote>

A lines section holds a run of lines. A line with a left indentation carries it as a custom property in its style attribute; a line without one has no style attribute:

<blockquote class="flm-pres-block flm-quote" data-flm-kind="address">
  <div class="flm-pres-block flm-quote-lines">
    <div class="flm-pres-lines">
      <div class="flm-pres-line" data-flm-align="left">123 Main St</div>
      <div class="flm-pres-line" style="--flm-element-indent-left: calc(1 * var(--flm-tab))" data-flm-align="left">City, ST 12345</div>
    </div>
  </div>
</blockquote>

The backend writes no tag or class specific to this feature: the classes come from the role and the kind tokens, as for every feature, so a stylesheet selects every quotation by the role’s class (.flm-quote), a quotation section by its role’s class, and one environment by its kind token (.flm-quote[data-flm-kind~="address"]).

§The stylesheet

The stylesheet stylesheet (flm.quote.style) is one cascade layer that sets a quotation apart from the text around it. Every quotation is indented on both sides and spaced above and below. A quote, and every environment a host configures, has a faint background and inner space, and its passages and lines are in italics; a blockquote is only indented, and an address is indented with its lines slightly smaller. A block section has a thin rule on its left, and an attribution is set on a line of its own, aligned to the right, after a dash. Each rule selects an environment by its kind token, never by the tag, and selects a quotation section only as a direct child of its quotation, so that a quotation nested in another keeps its own look. Every value it uses is a custom property declared in the stylesheet (--flm-quote-indent, --flm-quote-background, --flm-quote-attributed-lead and the others), which a page sets to change the look without writing a rule. A quotation also sets --flm-margin-note-inset to how far it is indented from the right of the text, so that a note shown in the margin and written inside the quotation still reaches the page’s column of notes (the margin rule of the HTML backend’s core stylesheet (STYLE_CORE) reads it).

The general rule requires the stylesheet at every quotation, so that a page holding no quotation carries none of it.

Constants§

STYLE
The identifier of the feature’s stylesheet, flm.quote.style (stylesheet), which the general rule QuoteRule requires at every quotation.

Functions§

stylesheet
Returns the feature’s stylesheet, flm.quote.style, as a style definition: one cascade layer that sets a quotation apart from the text around it, every value a custom property it declares. See the module documentation.