Skip to content

Instantly share code, notes, and snippets.

@exdeniz
Last active August 29, 2015 14:17
Show Gist options
  • Save exdeniz/02c976f04dcfc2e968f7 to your computer and use it in GitHub Desktop.
Save exdeniz/02c976f04dcfc2e968f7 to your computer and use it in GitHub Desktop.
Themes css
"use strict";
var gulp = require("gulp"),
postcss = require("gulp-postcss"),
gulp = require("gulp"),
csso = require("gulp-csso"),
replace = require('gulp-replace'),
prefix = require("postcss-prefix-selector"),
empty = require('postcss-discard-empty'),
rename = require("gulp-rename"),
filterDeclarations = require("postcss-filter-declarations");
// Собираем Stylus
gulp.task("theme", function() {
var processors = [
filterDeclarations({
props: [
"background-color",
"color",
"fill",
"border",
"border-bottom",
"border-top",
"border-left",
"border-right"
]
}),
empty(),
prefix({
prefix: '.red ' // <--- notice the traililng space!
})
];
return gulp.src("./public/css/blocks.css")
.pipe(postcss(processors))
.pipe(rename('blocks-red.css'))
.pipe(replace(/248dff/g, 'ff4569'))
.pipe(replace(/017afd/g, 'ff4569'))
.pipe(replace(/rgba\((36),(\d+),(\d+),([0-9]+\.[0-9]+|\d)\)/g, 'rgba(255,69,105,.03)'))
.pipe(gulp.dest("./public/css/"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment