0.19.0 • Published 1 month ago
@hidoo/gulp-task-build-css-stylus v0.19.0
@hidoo/gulp-task-build-css-stylus
Task that build css by stylus for gulp.
Installation
$ npm install --save-dev gulp@next @hidoo/gulp-task-build-css-stylus
Usage
basic:
import { task } from 'gulp';
import buildCss from '@hidoo/gulp-task-build-css-stylus';
task(
'css',
buildCss({
src: '/path/to/stylus/main.styl',
dest: '/path/to/dest'
})
);
remove unused CSS:
import { task } from 'gulp';
import buildCss from '@hidoo/gulp-task-build-css-stylus';
task(
'css',
buildCss({
src: '/path/to/stylus/main.styl',
dest: '/path/to/dest',
uncssTargets: ['/path/to/target.html']
})
);
API
buildCss
return css build task by stylus
Parameters
options
Object options (optional, default{}
)options.name
String task name (use as displayName) (optional, default'build:css'
)options.src
String source pathoptions.dest
String destination pathoptions.filename
String destination filename (optional, default'main.css'
)options.suffix
String suffix when compressed (optional, default'.min'
)options.browsers
Array[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)? target browsers. see: default target browsersoptions.banner
String license comments (optional, default''
)options.stylusOptions
Object stylus options. see: gulp-stylus options (optional, default{rawDefine:{}}
)options.url
String type of processing of url() (one of [inline|copy|rebase]) see: https://www.npmjs.com/package/postcss-url (optional, defaultnull
)options.urlOptions
Object options of processing of url() see: https://www.npmjs.com/package/postcss-url#options-combinations (optional, default{}
)options.uncssTargets
Array[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) array of html file path that target of uncss process (optional, default[]
)options.uncssIgnore
Array[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) array of selector that should not removed (optional, default[]
)options.additionalProcess
Function\ additional PostCss process (optional, defaultnull
)
Examples
import { task } from 'gulp';
import buildCss from '@hidoo/gulp-task-build-css-stylus';
task(
'css',
buildCss({
name: 'css:main',
src: '/path/to/stylus/main.styl',
dest: '/path/to/dest',
filename: 'styles.css',
suffix: '.hoge',
browsers: ['> 0.1% in JP'],
banner: '/*! copyright <%= pkg.author %> * /\n',
stylusOptions: { rawDefine: {} },
url: 'inline',
urlOptions: { basePath: path.resolve(process.cwd(), 'src/images') },
uncssTargets: ['/path/to/html/target.html'],
uncssIgnore: ['.ignore-selector'],
additionalProcess: (root) => root,
compress: true
})
);
Returns Function[Stream](https://nodejs.org/api/stream.html)
Test
$ pnpm test
License
MIT
1.0.0-alpha.1
1 month ago
1.0.0-alpha.0
3 months ago
0.19.0
3 years ago
0.18.0
3 years ago
0.17.0
3 years ago
0.16.0
3 years ago
0.15.0
4 years ago
0.14.1
4 years ago
0.14.0
4 years ago
0.13.0
5 years ago
0.12.0
5 years ago
0.11.0
5 years ago
0.10.0
5 years ago
0.9.0
5 years ago
0.8.4
5 years ago
0.8.3
5 years ago
0.8.2
5 years ago
0.8.1
5 years ago
0.8.0
5 years ago
0.7.0
5 years ago
0.6.2
6 years ago
0.6.1
6 years ago
0.6.0
6 years ago
0.5.0
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago