This is a library for turning a SCSS stylesheet into HTML and CSS. Merge your CSS and HTML into one file for a simpler markup writing experience.
$bg: #f5f6f9;
$text: "Hello World";
html {
head {
link {
-rel: "stylesheet";
-href: "index.css";
}
}
body {
background: $bg;
a {
-href: "https://google.com";
h1 {
text: $text;
}
}
}
}
a {
text-decoration: none;
}
- Create an index.scss file in /src
- Add your SCSS. For the SCSS to be transformed, you must have a top level "html" selector with all your markup inside. You can import other stylesheets using SCSS.
- Run
npm run dev
to run the Express server and watch for changes - Go to localhost:8000 to view your markup
zipperMerge is an async function that takes an inputPath and an outputFolder
await zipperMerge(path.join(__basedir, './src/index.scss'), './build');
To create an element, create a selector
h2 {
color: blue;
}
If you don't have an element at the start and just use a class or ID selector, the element will be a div.
.example {
text: "This element is a div";
}
You can add text with the "text" property. Make sure to put your text between quotes.
You can add an attribute to your element by starting your property with a hyphen (-).
a.example {
-href: "https://google.com";
}