# gulp-scss-inline

> complie inline style writted by scss to css with autoprefixer

Latest version **1.0.6** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-scss-inline
pnpm add gulp-scss-inline
yarn add gulp-scss-inline
bun add gulp-scss-inline
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-11-19 |
| First published | 2019-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Author | xpfei |
| Maintainers | xpfei |
| Keywords | gulp, inline, scss, css, autoprefixer |

## Links

- npm: https://www.npmjs.com/package/gulp-scss-inline
- npm.io page: https://npm.io/package/gulp-scss-inline

## Dependencies (5)

- [postcss](https://npm.io/package/postcss.md) ^7.0.21
- [through2](https://npm.io/package/through2.md) ^3.0.1
- [node-sass](https://npm.io/package/node-sass.md) ^4.13.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^9.7.1
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.26.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-11-19
- 1.0.5 — 2020-10-09
- 1.0.4 — 2020-09-18
- 1.0.3 — 2019-12-04
- 1.0.2 — 2019-12-04
- 1.0.1 — 2019-11-14
- 1.0.0 — 2019-11-14
- 0.0.2 — 2019-11-13
- 0.0.1 — 2019-11-13

## README

# gulp-scss-inline

> compiler inline style with scss to css

## Install

Using npm:

```sh
npm i -D gulp-scss-inline
```

or using yarn:

```sh
yarn add -D gulp-scss-inline
```

## Using

```scss
<style type="text/scss">
  body {
    .test {
      h1 {
        color: red;
      }
    }
  }
</style>
```

> 内容为css 且需要添加前缀 必须添加 type="text/css"
```css
<style type="text/css">
  .test {
    color: red;
  }
</style>
```

require packages

```js
const
    gulp        = require('gulp'),
    scssInline   = require('gulp-scss-inline'),
    htmlMin     = require('gulp-htmlmin');
```

create task
```js
//only babel in Html
gulp.task('scssInline', () =>
    gulp.src([srcDir + '/**/*.html'])
        .pipe(scssInline())
        .pipe(gulp.dest(targetDir))
);

//used with html-min
gulp.task('htmlMin', function () {
    let minOptions = {
        removeComments: true,
        collapseWhitespace: true,
        collapseBooleanAttributes: false,
        removeEmptyAttributes: false,
        removeScriptTypeAttributes: true,
        removeStyleLinkTypeAttributes: true,
        minifyJS: true,
        minifyCSS: true
    };
    gulp.src([srcDir + '/**/*.html'])
        .pipe(scssInline())
        .pipe(htmlMin(minOptions))
        .pipe(gulp.dest(targetDir));
});
```

---
_Source: https://npm.io/package/gulp-scss-inline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
