mirror of
https://github.com/wu736139669/Monkey-Test.git
synced 2026-08-05 05:55:46 +00:00
16 lines
384 B
JavaScript
16 lines
384 B
JavaScript
'use strict';
|
|
|
|
var postcss = require('postcss');
|
|
|
|
function optimise (decl) {
|
|
var value = decl.value;
|
|
// AST values must be strings
|
|
decl.value = value === 'normal' ? '400' : value === 'bold' ? '700' : value;
|
|
}
|
|
|
|
module.exports = postcss.plugin('postcss-minify-font-weight', function () {
|
|
return function (css) {
|
|
css.eachDecl('font-weight', optimise);
|
|
};
|
|
});
|