Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color module support #7

Open
Kingdutch opened this issue Sep 24, 2018 · 1 comment
Open

Add color module support #7

Kingdutch opened this issue Sep 24, 2018 · 1 comment
Labels
enhancement New feature or request release blocker This issue blocks the release of a new stable version
Milestone

Comments

@Kingdutch
Copy link
Member

The current gulp workflow creates some separate stylesheets for the color module preview (with a class prefix). This is not yet supported in Sweet Pea but should be added.

@Kingdutch Kingdutch added the enhancement New feature or request label Sep 24, 2018
@Kingdutch
Copy link
Member Author

Kingdutch commented Jan 10, 2019

The current implementation is the following:

// #########################
// Color preview
//
// We generate a separate prefixed stylesheet for the preview
// so it will affect any element outside the preview.
// #########################

const prefixCss = require('gulp-prefix-css');

gulp.task('preview-base', function () {
  return gulp.src([
    options.basetheme.css + 'base.css',
    options.basetheme.css + 'badge.css',
    options.basetheme.css + 'button.css',
    options.basetheme.css + 'cards.css',
    options.basetheme.css + 'comment.css',
    options.basetheme.css + 'form-controls.css',
    options.basetheme.css + 'form-elements.css',
    options.basetheme.css + 'form-post-create.css',
    options.basetheme.css + 'hero.css',
    options.basetheme.css + 'layout.css',
    options.basetheme.css + 'media.css',
    options.basetheme.css + 'navbar.css',
    options.basetheme.css + 'nav-tabs.css',
    options.basetheme.css + 'stream.css',
    options.basetheme.css + 'teaser.css'
  ])
    .pipe(concat('preview-base.css'))
    .pipe(prefixCss('.color-preview'))
    .pipe(gulp.dest(options.theme.root + 'color/css/'));
});

gulp.task('preview-blue', function () {
  return gulp.src(options.theme.components + 'preview.scss')
    .pipe(sass(options.sass).on('error', sass.logError))
    .pipe($.plumber({errorHandler: onError}))
    // run autoprefixer and media-query packer
    .pipe($.postcss(sassProcessors))
    // run rucksack @see https://simplaio.github.io/rucksack/
    .pipe($.rucksack())
    .pipe(prefixCss('.color-preview'))
    .pipe(gulp.dest(options.theme.css));
});

gulp.task('preview', ['preview-base', 'preview-blue']);

@Kingdutch Kingdutch added the release blocker This issue blocks the release of a new stable version label Jan 10, 2019
@Kingdutch Kingdutch added this to the 1.0.0 milestone Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release blocker This issue blocks the release of a new stable version
Development

No branches or pull requests

1 participant