在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):RWS/gulp-svg-css开源软件地址(OpenSource Url):https://github.com/RWS/gulp-svg-css开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-svg-cssGulp plugin that embeds svg images inside a single CSS file using data-uri. UsageExample usage of the plugin: var gulp = require('gulp');
var svgcss = require('gulp-svg-css');
var svgmin = require('gulp-svgmin');
gulp.task('create-css', function () {
return gulp
.src('icons/**/*.svg')
.pipe(svgmin())
.pipe(svgcss({
fileName: 'icons',
cssPrefix: 'icon-',
addSize: false
}))
.pipe(gulp.dest('dist/'));
});
}); APIsvgcss(options)options.fileNameType: Name of the target css file. options.fileExtType: File extension of the target file. options.cssPrefixType: A string to prefix all css classes with. options.cssSelectorType: A selector to use for the CSS prefix. This is particularly useful if you're outputting a SASS partial, and would rather use a options.addSizeType: Adds width and height property to the css class.
The size is retrieved using the width and height attribute on the svg root element. If no size is set the options.defaultWidthType: Only used if A string that MUST be defined in px that will be the size of the background-image if there is no width given in the SVG element. options.defaultHeightType: Only used if Similar to defaultWidth, but for height. Running tests
Check code style
LicenseCopyright (c) 2015 All Rights Reserved by the SDL Group. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论