0.1.22 • Published 3 years ago

sass-to-html v0.1.22

Weekly downloads
5
License
ISC
Repository
github
Last release
3 years ago

Sass-to-html

Sass-to-html provides a command-line sass compilation directly into an HTML file into a <style> tag.

Example

You have to have one HTML input and one SCSS input (which can @import another SCSS files).

Input

index.html (without styles)

<html>
<head>
    <title>My great title</title>
</head>
<body>
   <p>Hello world!</p>
</body>
</html>

style.scss

$primary: green;
body {
   color: $primary;
}

Command

sass-to-html 

Result

original index.html has been modified:

<html>
<head>
    <title>My great title</title>
    <style>body{color:green}</style>
</head>
<body>
   <p>Hello world!</p>
</body>
</html>

Usage

After installation command sass-to-html should be available in your environment.

sass-to-html [options]

Or you can run it manually with absolute path

node path/to/sass-to-html/index.js [options]

Options:

shortlongdescription
-V,--versionoutput the version number
-d,--debugoutput extra log
-w,--watchwatch selected .scss file (default: false)
-i,--html path to .html file (default: "index.html")
-s,--scss path to .scss file (default: "style.scss")
-h,--helpdisplay help for command