Step apply-stylesheets {http://www.daisy.org/ns/pipeline/xproc}

Apply CSS, SCSS and/or XSLT stylesheets

Defined in: http://www.daisy.org/pipeline/modules/braille/common-utils/library.xpl

Input Ports

Port Description
source primary

Style sheets can be associated with the source in several ways: linked (using an xml-stylesheet processing instruction or a link element), embedded (using a style element) and/or inlined (using style attributes).

context sequence

Style sheets that are linked to from the source document, or included via the 'stylesheets' option, must either exist on disk, or must be provided in memory via this port. Style sheets on this port must be wrapped in <c:result content-type="text/plain"> elements. Style sheet URIs are resolved by matching against the context documents's base URIs.

parameters parameter

Parameters that are passed to XSLT transformations and SCSS style sheets (as global variables).

Output Ports

Port Description
result primary

Style sheets are applied to the document in the following way: XSLT style sheets are applied before CSS/SCSS style sheets. XSLT style sheets are applied one by one, first the ones from the 'stylesheets' option, then the ones associated with the source document, in the order in which they are specified. CSS/SCSS style sheets are applied by "inlining" them, i.e. performing the cascade and capturing the styles of individual elements in style attributes, using the syntax described in braille CSS. All CSS/SCSS style sheets are applied at once, but the order in which they are specified (first the ones from the 'stylesheets' option, then the ones associated with the source document) has an influence on the cascading order.

result.parameters

A c:param-set document containing all the parameters on the parameters input port, augmented with any global variables declared in SCSS style sheets. Variables that are declared later take precedence, except if they are declared with !default.

Options

Local Name Namespace URI Default Description
stylesheets ''

A space separated list of URIs, absolute or relative to source. XSLT style sheets must be specified before CSS/SCSS style sheets.

type 'text/css text/x-scss text/xsl'

The type of associated style sheets to apply. May be a space separated list. Allowed values are "text/css", "text/x-scss", "text/xsl" and "application/xslt+xml". If omitted, all CSS, SCSS and XSLT style sheets are applied.

media 'embossed'

The target medium type as a media query. All rules that are contained in a style sheet that matches the specified medium are included. Supported media types are "embossed" and "print". When the target medium is embossed, CSS is interpreted according to the rules of braille CSS. Supported media features are 'width' and 'height'.