scripts/gulp/styles.js
function stylesComponents() {
  return gulp.src( 'packages/' + ( component || '*' ) + '/src/*.less' )
    .pipe( gulpIgnore.exclude( vf => {
      /* Exclude Less files that don't share the same name as the directory
         they're in. This filters out things like cf-vars.less but still
         includes cf-core.less. */
      const matches = vf.path.match( /\/([\w-]*)\/src\/([\w-]*)\.less/ );
      // We also exclude cf-grid. It needs its own special task. See below.
      return matches[2] === 'cf-grid' || matches[1] !== matches[2];
    } ) )
    .pipe( gulpLess( {
      paths: [ 'node_modules/cf-*/src/' ],
      compress: true
    } ) )
    .pipe( gulpPostcss( [
      autoprefixer( {
        browsers: BROWSER_LIST.LAST_2_PLUS_IE_8_AND_UP
      } )
    ] ) )
    .pipe( gulpRename( path => {
      path.dirname = component || path.dirname;
      path.dirname = path.dirname.replace( '/src', '' );
      path.extname = '.min.css';
    } ) )
    .pipe( gulp.dest( 'packages' ) );
}
function stylesComponents() {
  return gulp.src( 'packages/' + ( component || '*' ) + '/src/*.less' )
    .pipe( gulpIgnore.exclude( vf => {
      /* Exclude Less files that don't share the same name as the directory
         they're in. This filters out things like cf-vars.less but still
         includes cf-core.less. */
      const matches = vf.path.match( /\/([\w-]*)\/src\/([\w-]*)\.less/ );
      // We also exclude cf-grid. It needs its own special task. See below.
      return matches[2] === 'cf-grid' || matches[1] !== matches[2];
    } ) )
    .pipe( gulpLess( {
      paths: [ 'node_modules/cf-*/src/' ],
      compress: true
    } ) )
    .pipe( gulpPostcss( [
      autoprefixer( {
        browsers: BROWSER_LIST.LAST_2_PLUS_IE_8_AND_UP
      } )
    ] ) )
    .pipe( gulpRename( path => {
      path.dirname = component || path.dirname;
      path.dirname = path.dirname.replace( '/src', '' );
      path.extname = '.min.css';
    } ) )
    .pipe( gulp.dest( 'packages' ) );
}
function stylesComponents ( ) { return gulp . src ( 'packages/' + ( component || '*' ) + '/src/*.less' ) . pipe ( gulpIgnore . exclude ( vf => { /* Exclude Less files that don't share the same name as the directory
         they're in. This filters out things like cf-vars.less but still
         includes cf-core.less. */ const matches = vf . path . match ( / \/([\w-]*)\/src\/([\w-]*)\.less / ) ; // We also exclude cf-grid. It needs its own special task. See below. return matches [ 2 ] === 'cf-grid' || matches [ 1 ] !== matches [ 2 ] ; } ) ) . pipe ( gulpLess ( { paths : [ 'node_modules/cf-*/src/' ] , compress : true } ) ) . pipe ( gulpPostcss ( [ autoprefixer ( { browsers : BROWSER_LIST . LAST_2_PLUS_IE_8_AND_UP } ) ] ) ) . pipe ( gulpRename ( path => { path . dirname = component || path . dirname ; path . dirname = path . dirname . replace ( '/src' , '' ) ; path . extname = '.min.css' ; } ) ) . pipe ( gulp . dest ( 'packages' ) ) ; }
Compile all the individual component files so that users can `npm install`
a single component if they desire.
@returns {PassThrough} A source stream.
Compile all the individual component files so that users can npm install a single component if they desire .