This document provides an overview of the styling mechanism in the Singularity framework. It explains how to use the inlineImport function to include CSS files in your application.
The inlineImport function can be used to import CSS files that will be included in the final HTML page as inline style tags. This helps in keeping the styles modular and scoped to specific components.
Example:
{inlineImport({ src: "counter.css" })}
Component contentThe CSS file will be included once per render and will not be hydrated by the client, as it does not have any interactivity.
The imported CSS files are not CSS modules, so you need to use normal CSS syntax techniques like nesting for scoping. This ensures that the styles are applied only to the intended elements.
Example:
.counter {
p {
color: red;
/* this will be a scoped style */
}
}