Commit d2c2a40d authored by Nikolay Gromov's avatar Nikolay Gromov

fix

parent 0476ab42
...@@ -4,7 +4,8 @@ const gulp = require('gulp'); ...@@ -4,7 +4,8 @@ const gulp = require('gulp');
const less = require('gulp-less'); const less = require('gulp-less');
const debug = require('gulp-debug'); const debug = require('gulp-debug');
const sourcemaps = require('gulp-sourcemaps'); const sourcemaps = require('gulp-sourcemaps');
const cssnano = require('gulp-cssnano'); const cleanss = require('gulp-cleancss');
const combineMq = require('gulp-combine-mq');
const autoprefixer = require('gulp-autoprefixer'); const autoprefixer = require('gulp-autoprefixer');
const rename = require('gulp-rename'); const rename = require('gulp-rename');
const gulpIf = require('gulp-if'); const gulpIf = require('gulp-if');
...@@ -41,7 +42,10 @@ gulp.task('less', function () { ...@@ -41,7 +42,10 @@ gulp.task('less', function () {
.pipe(autoprefixer({ .pipe(autoprefixer({
browsers: ['last 2 versions'] browsers: ['last 2 versions']
})) }))
.pipe(cssnano()) .pipe(combineMq({
beautify: false
}))
.pipe(cleanss())
.pipe(rename('style.min.css')) .pipe(rename('style.min.css'))
.pipe(debug({title: "RENAME:"})) .pipe(debug({title: "RENAME:"}))
.pipe(gulpIf(isDev, sourcemaps.write('.'))) .pipe(gulpIf(isDev, sourcemaps.write('.')))
...@@ -53,9 +57,10 @@ gulp.task('less', function () { ...@@ -53,9 +57,10 @@ gulp.task('less', function () {
gulp.task('copy:css', function() { gulp.task('copy:css', function() {
console.log('---------- копирование CSS'); console.log('---------- копирование CSS');
return gulp.src('src/css/*.css', {since: gulp.lastRun('copy:css')}) return gulp.src('src/css/*.css', {since: gulp.lastRun('copy:css')})
.pipe(cssnano({ .pipe(combineMq({
discardUnused: false // не удалять неиспользованные конструкции beautify: false
})) }))
.pipe(cleanss())
.pipe(rename(function (path) { .pipe(rename(function (path) {
path.extname = '.min.css' path.extname = '.min.css'
})) }))
......
.row {
.row();
}
// Классы модульной сетки для XS — срабатывают на всех ширинах
.make-column-list-general-rules(xs); // список всех селекторов .col-xs-... и их обще свойства
.make-columns(@grid-columns, xs); // ширины для каждого селектора .col-xs-... отдельно
.make-offsets(@grid-columns, xs); // левые отступы для каждого селектора .col-xs-offset-...
// Классы модульной сетки для SM — срабатывают на ширине @screen-sm (по умолчанию: 480px)
.make-column-list-general-rules(sm); // список всех селекторов .col-sm-... и их обще свойства
@media (min-width: @screen-sm) {
.make-columns(@grid-columns, sm); // ширины для каждого селектора .col-sm-... отдельно
.make-offsets(@grid-columns, sm); // левые отступы для каждого селектора .col-sm-offset-...
}
// Классы модульной сетки для MD — срабатывают на ширине @screen-md (по умолчанию: 768px)
.make-column-list-general-rules(md); // список всех селекторов .col-md-... и их обще свойства
@media (min-width: @screen-md) {
.make-columns(@grid-columns, md); // ширины для каждого селектора .col-md-... отдельно
.make-offsets(@grid-columns, md); // левые отступы для каждого селектора .col-md-offset-...
}
// Классы модульной сетки для LG — срабатывают на ширине @screen-lg (по умолчанию: 992px)
.make-column-list-general-rules(lg); // список всех селекторов .col-lg-... и их обще свойства
@media (min-width: @screen-lg) {
.make-columns(@grid-columns, lg); // ширины для каждого селектора .col-lg-... отдельно
.make-offsets(@grid-columns, lg); // левые отступы для каждого селектора .col-lg-offset-...
}
// Классы модульной сетки для XL — срабатывают на ширине @screen-xl (по умолчанию: 1200px)
.make-column-list-general-rules(xl); // список всех селекторов .col-xl-... и их обще свойства
@media (min-width: @screen-xl) {
.make-columns(@grid-columns, xl); // ширины для каждого селектора .col-xl-... отдельно
.make-offsets(@grid-columns, xl); // левые отступы для каждого селектора .col-xl-offset-...
}
// Классы модульной сетки для XXL — срабатывают на ширине @screen-xxl (по умолчанию: 1890px)
// .make-column-list-general-rules(xxl); // список всех селекторов .col-xxl-... и их обще свойства
// @media (min-width: @screen-xxl) {
// .make-columns(@grid-columns, xxl); // ширины для каждого селектора .col-xxl-... отдельно
// .make-offsets(@grid-columns, xxl); // левые отступы для каждого селектора .col-xxl-offset-...
// }
//------------------------------------------------------------------------------
// Общие правила
//------------------------------------------------------------------------------
// Make viewport responsive // Make viewport responsive
// see http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/ // see http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
@at-root { @at-root {
...@@ -35,6 +39,10 @@ textarea { ...@@ -35,6 +39,10 @@ textarea {
//------------------------------------------------------------------------------
// Теги: общее и типографика
//------------------------------------------------------------------------------
*, *:before, *:after { *, *:before, *:after {
box-sizing: inherit; box-sizing: inherit;
} }
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Генератор списка селекторов .col-[]-[] и их общих свойств // Генератор списка селекторов .col-[указанный тип]-[] и их общих свойств
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Принимает: // Принимает:
// @screen: xs - тип сетки [xs|sm|md|lg|xl|xxl] // @screen: xs - тип сетки [xs|sm|md|lg|xl|xxl]
...@@ -131,16 +131,16 @@ ...@@ -131,16 +131,16 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Генератор селекторов .col-[]-[] и их индивидуальных свойств (ширин) // Генератор селекторов .col-[указанный тип]-[] и их индивидуальных свойств (ширин)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Принимает: // Принимает:
// @n: - количество колонок // @n: - количество колонок
// @screen: - тип сетки [xs|sm|md|lg|xl|xxl] // @screen: - тип сетки [xs|sm|md|lg|xl|xxl]
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
.make-columns(@n, @screen, @i: 1) when (@i =< @n) { .make-columns(@n: @grid-columns, @screen: xs, @i: 1) when (@i =< @n) {
.col-@{screen}-@{i} { .col-@{screen}-@{i} {
.make-col(@i, @grid-columns, false) .make-col(@i, @n, false)
} }
.make-columns(@n, @screen, (@i + 1)); .make-columns(@n, @screen, (@i + 1));
} }
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
// @screen: - тип сетки [xs|sm|md|lg|xl|xxl] // @screen: - тип сетки [xs|sm|md|lg|xl|xxl]
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
.make-offsets(@n, @screen, @i: 1) when (@i =< @n) { .make-offsets(@n: @grid-columns, @screen: xs, @i: 1) when (@i =< @n) {
.col-@{screen}-offset-@{i} { .col-@{screen}-offset-@{i} {
margin-left: (@i * 100% / @n); margin-left: (@i * 100% / @n);
} }
......
@import "variables.less"; @import "variables.less";
@import "mixins/mixins.less"; @import "mixins/mixins.less";
@import "global.less"; @import "global_scaffolding.less";
@import "global_grid.less";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment