grunt-sass-unicode
This is to solve unicode issue with SASS.
This is heavily inspired by gulp-sass-unicode, the only reason I do this is offering guys using grunt have a solution for the unicode issue with SASS.
Intend to solve
You might encounter an issue that you need to generate a css file with SASS and a custom font, and it turns into something like this:
content: "口";
when it should be something like this:
content: '\f101';
This plugin is just about replacing the broken characters inside content
value with the correct ones.
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-sass-unicode --save-dev
or
yarn add -D grunt-sass-unicode
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-sass-unicode');
Usage Example with grunt-sass
This plugin follows files object format, where the property name is the destination file, and its value is the source.
grunt.initConfig({
sass: {
dist: {
files: {
'./dist/main.css': './src/main.scss'
}
}
},
sassUnicode: {
files: {
'./dist/main.css': './dist/main.css',
},
},
});
grunt.registerTask('default', ['sass', 'sassUnicode']);
Contributing
Lint and test your code before submitting your contribution.
License
MIT