gulp-sass-in-html

1.0.1 • Public • Published

Gulp sass in html

Sass compilation in html and pug


Install

You can get gulp-sass-in-html from NPM:

To save to a project as a dev dependency

npm install gulp-sass-in-html --save-dev

Example

gulpfile.js

var sassInHtml = require('gulp-sass-in-html');
 
gulp.src('src/test.html')
      .pipe(sassInHtml())
      .pipe(gulp.dest('dist'));

src/test.html

<html>
<head>
  <style type="text/sass">
    body
      background: black
      color: red
      .love
        color: red
        font-size: 12px
  </style>
</head>
<body>
</body>
</html>

dist/test.html

<html>
<head>
  <style type="text/css">
    body {
      background: black;
      color: red; }
      body .love {
        color: red;
        font-size: 12px; }
  </style> 
</head>
<body>
</body>
</html>

Use in pug.js

html
  head
  .
    <style type="text/sass">
      body
        background: black
        color: red
        .love
          color: red
          font-size: 12px
    </style>

recommended indentation

indent type: spaces indent length: 2 spaces

Readme

Keywords

Package Sidebar

Install

npm i gulp-sass-in-html

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • tongjieme