Static CSS Generation (SCG) allows you to pre-generate CSS from HTML.
If you prefer pre-generating your CSS without relying on the runtime engine, You can use Mojo's Static CSS Generation (SCG) module.
import MojoSCG from "mojocss/src/interop/scg.js"
const htmlString = ""; // Static HTML content
const config = {}; // Mojo's Configuration options
const scg = new MojoSCG(htmlString, config)
const css = scg.render();
The css
variable contains the generated CSS styles. You can inject these styles into a <style>
tag inside the <head>
section of your HTML document.