Sass
Three stylesheets of the HTML folder are built from Sass in the SOURCE toolkit: css/main.css, css/vendor.css and css/components.css. Edit the Sass, and npm run build writes all three: SOURCE toolkit. Colours, fonts, sizes and spacing are not here: they are the variables in css/variables.css, which you edit the same way with or without the toolkit (Colours and schemes). The Sass uses the indented syntax, .sass.
How to access
SOURCE/src/styles and SOURCE/packages/components
| Sass | Built into |
|---|---|
src/styles/main.sass, and the files it loads: _schemes.sass, _type.sass, defaults/ | css/main.css |
src/styles/bootstrap.sass: Bootstrap's grid and layout classes | css/vendor.css |
packages/components/src/components/<Name>/<Name>.sass, one per component | css/components.css |
css/main.css keeps a table of contents at its top and a numbered banner above each part, named as in main.sass: Schemes, Type styles, Defaults: header. Find a rule in the built sheet, and the banner tells you which Sass file it comes from.
Adding a scheme
A scheme sets six roles, each to a colour of css/variables.css. The schemes are a map in src/styles/_scheme.sass, and _schemes.sass writes each on its data-bs-theme value. Here a sand scheme, on the Stone background:
sass
$schemes: (sand: (background: stone, heading: dark, text: dark-soft, muted: gray-on-stone, border: border-on-light, hover: dark), light: (…), …)sass
[data-bs-theme="sand"]
+scheme(sand)After the build, css/main.css holds [data-bs-theme=sand], and a section takes it with data-bs-theme="sand". To change one of the template's schemes, change its line in the map. A colour of your own goes into css/variables.css first, as a --velum-color-… variable: the map names it without the prefix.
The type classes
src/styles/_type.sass writes the 20 type classes from its $presets list. Each class reads its seven values, its font, sizes, weight, line height, letter spacing and capitals, from css/variables.css, so a size or a font is changed there, without a build: Fonts and type. The Sass is the place to add a class: its name in $presets, and its seven variables in css/variables.css, written like the others.
Changing a component's default look
src/styles/defaults/ holds one file per part of the template, _accordion.sass, _header.sass and so on. Each sets the part's look as custom properties on its class, against the colours and spacing of css/variables.css. Here the Accordion's dotted lines become solid:
sass
.accordion
--accordion-question-color: var(--velum-color-heading)
…
--accordion-rule-style: solid
--accordion-rule-color: var(--velum-color-border)The component's own sheet, packages/components/src/components/Accordion/Accordion.sass, reads those properties. Change the defaults first: the component sheets carry the mechanics the scripts rely on.
Without the toolkit
The same property, set in css/custom.css on the same class, changes the look without a build, and an update keeps it: .accordion { --accordion-rule-style: solid; }.
Next: Use in a CMS.