Section 49.3 How a Theme Is Assembled
Each PreTeXt work relies on a single
theme.css file for all of its styling. That file is built from a single SCSS entry file (for example targets/html/default-modern/theme-default-modern.scss) does three things: it declares the variables a publisher may override (each marked !default); it pulls in components and a color palette with @use; and it finishes by emitting the css variables defined by the imported files.
The
css/README.md describes ways themes are differentiated. In general, the files in a target/ folder are only expected to be used by that target, so they can contain rules that are specific to that theme. Anything in the components folder is shared across targets, so it must work well across different themes and color palettes.
Simple, local styles for a small component can likely be written without much extra work to integrate with various themes. The most likely complications are setting colors (Section 49.4), fonts (Section 49.5), or items that need to be placed or sized relative to other elements on the page (Section 49.6).
