balion
@balion
Junior front-end developer

Как сделать красивый скомпилированный сss код, после планига gulp-sass?

Как сделать красивый скомпилированный сss код,со всеми отступами и пробелами после планига gulp-sass?

Вот так сейчас выглядит мой сss
.second-column table {
  width: inherit;
  margin-top: 17px;
  border-collapse: separate;
  border-spacing: 0 5px; }
  .second-column table tr {
    text-align: center;
    height: 70px;
    line-height: 70px;
    background: #ecf0ea; }
  .second-column table thead {
    line-height: 30px;
    font-family: 'open_sansbold';
    font-size: 16px;
    color: #5f5f5f;
    text-align: center; }
    .second-column table thead tr {
      background: none !important; }
  .second-column table tbody .item-counter {
    position: relative;
    padding-left: 5px;
    width: 50px; }
    .second-column table tbody .item-counter p {
      display: inline-block;
      margin: 0 auto;
      width: 30px;
      height: 30px;
      text-align: center;
      line-height: 30px;
      font-family: 'open_sansregular';
      text-decoration: underline;
      font-size: 18px;
      color: #328dba; }


Хояу,чтобы выглядело так
.ct-chart .ct-grid {
	stroke: white;
}

#steps {
	width: 700px;
	height: 150px;
	margin:50px auto;
	background: yellow;
	text-align: center;
	text-transform: uppercase;
	font-family: Arial;
	font-size:30px;
	line-height: 60px;
}

td {
	min-width: 100px;
}

tr td:first-child {
	background-color: #3D83CA;
}


Вот исходник gulpfile.js

var gulp = require('gulp'),
	uglify = require('gulp-uglify'),
	sass = require('gulp-sass'),
	plumber = require('gulp-plumber'),
	//livereload = require('gulp-livereload'),
	prefix = require('gulp-autoprefixer'),
	jade = require('gulp-jade'),
	obfuscate = require('gulp-obfuscate'),
	//concatCss = require('gulp-concat-css'),
	minifyCSS = require('gulp-minify-css');
	// jadephp = require('gulp-jade-php');


//Scripts Task
//Uglifies
gulp.task('scripts',function(){
	gulp.src('js/*.js')
		.pipe(plumber())
		//.pipe(uglify())
		.pipe(gulp.dest('output/html-templates/gamingclouds/minjs'));
});

//Styles Task
//Sass
gulp.task('sass',function(){
	gulp.src('scss/**/*.scss')
		.pipe(plumber())
		.pipe(sass())
		.pipe(prefix('last 10 versions'))
		.pipe(gulp.dest('output/html-templates/gamingclouds/css/'));
});

//Minify css



//Watch Task JS,Sass,Jade
gulp.task('watch',function(){
	gulp.watch('js/*.js', ['scripts'])  //**.*.js
	gulp.watch('scss/**/*.scss', ['sass']);
	gulp.watch('jade/*.jade', ['jade']);
	//gulp.watch('output/css/*.css',['minifycss']);
});


//Simple Jade task 
gulp.task('jade', function() {
  gulp.src('jade/*.jade')
  	.pipe(plumber())
    .pipe(jade({pretty:true}))
    //.pipe(obfuscate())
    .pipe(gulp.dest('output/html-templates/gamingclouds'))
});

//Jade to php 





gulp.task('default',['scripts','sass','jade','watch']);
  • Вопрос задан
  • 2332 просмотра
Пригласить эксперта
Ответы на вопрос 5
reskwer
@reskwer
front-end developer
Замените пайп на этот
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))


или в ручную допишите в своем пайпе
{outputStyle: 'expanded'}
Ответ написан
mikaspell
@mikaspell
Frontender
gulp-sass - интерпритация sass на libsass, а libsass в данный момент поддерживает типы выходного файла - nested и compressed. Красивый или expanded - не поддерживается, используйте оригинальный sass, написанный на ruby.
Ответ написан
Antonoff
@Antonoff
Разработчик
Тут есть 2 варианта:

1. В ручную
2. Я делаю копипейст в jsfiddle.net и нажимаю TidyUp, быстро, чётко, молодежно.
Ответ написан
rajdee
@rajdee
Front-end developer
Воспользуйтесь "расческой" - CSScomb
В комплекте идут предустановленные пресеты-стайлгайды (Zem, Yandex, CSSComb) или вы можете настроить конфиг под себя.
Есть модули под Grunt и Gulp
Ответ написан
Комментировать
igorperegudov
@igorperegudov
Frontend-developer
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы