postcss-tag-to-id
v0.1.7
Published
tag to id
Downloads
5
Readme
postcss-tag-to-id
root tags to id
Install
npm install --save postcss-tag-to-id
Usage
source.html
<about>
<h1 id="homepage">About</h1>
</about>
<script type="text/javascript">
vnjs.on('load',()=>{})
</script>
<game-over>
<h1 class='game-over'>Game Over</h1>
</game-over>
<style type="text/css">
.game-over{}
#homepage{}
about{
color: cyan;
}
game-over{
padding: 15px;
}
</style>
gulpfile.js
const
gulp = require('gulp'),
postcss = require('gulp-postcss'),
concat = require('gulp-concat');
gulp.task('css', function () {
let plugins = [
require('postcss-tag-to-id')({prefix: "#vnjson__"})
];
gulp.src(['./src/screens/**/*.css'])
.pipe(postcss(plugins))
.pipe(concat('style.css'))
.pipe(gulp.dest('./dest'))
});
output.css
.game-over{}
#homepage{}
#vnjson__about{
color: cyan;
}
#vnjson__game-over{
padding: 15px;
}
Options
{
prefix: 'string'
}
LICENSE
MIT Lisense (MIT)