Skip to content

Commit

Permalink
fix: remove CSS post processing #11
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon committed Feb 26, 2020
1 parent 31bf54a commit ca09c2b
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 114 deletions.
7 changes: 1 addition & 6 deletions template/.travis.temp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ notifactions:

before_script:
- npm run buildTokens
- gulp processSrc
- gulp processImportsCanonical
- gulp processImportsVariable
- npm run stylefluxCanonical
- npm run stylefluxVariable
- gulp reprocessClean
- npm run processSrc
- npm run distTokens
- npm run sassRender
- npm run distJS
Expand Down
8 changes: 5 additions & 3 deletions template/demo/sass/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Import Auro tokens
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/SCSSVariables";
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/SassCustomProperties";

// Import generated Design Token variables
@import "./demo/sass/tokenVariables";
@import "./demo/sass/tokenProperties";
// Import deprecated Design Token variables to support Orion values
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/tokenVariables";

// Import baseline library dependencies
// Mixins
Expand Down
198 changes: 99 additions & 99 deletions template/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ const gulp = require('gulp'),
postcssCustomProperties = require('postcss-custom-properties'),
postcss = require('gulp-postcss'),
removeSelectors = require('postcss-remove-selectors'),
StyleDictionary = require('style-dictionary'),
copyfiles = require('copyfiles'),
selectorReplace = require('postcss-selector-replace');
StyleDictionary = require('style-dictionary');
//copyfiles = require('copyfiles'),
//selectorReplace = require('postcss-selector-replace');

// task to copy font files from the OWCSS npm to the local project
// resources are NOT to be committed to version control
gulp.task('copyFonts', function(cb) {
copyfiles(
[
'./node_modules/@alaskaairux/orion-web-core-style-sheets/dist/fonts/*.*',
'./demo/fonts/',
],
true,
cb
);
cb();
});
// gulp.task('copyFonts', function(cb) {
// copyfiles(
// [
// './node_modules/@alaskaairux/orion-web-core-style-sheets/dist/fonts/*.*',
// './demo/fonts/',
// ],
// true,
// cb
// );
// cb();
// });

// task to build CSS/Sass resources from Token JSON files
gulp.task('buildTokens', function(cb) {
Expand Down Expand Up @@ -112,75 +112,75 @@ gulp.task('processSrc', function() {
);
});

// task for Production Sass processing and legacy support
gulp.task('processImportsCanonical', function() {
// set path to where Sass files are located to be processed
return (
gulp
.src('./src/*.scss')

// Sass pipeline
.pipe(
gulpSass({
errLogToConsole: true,
outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
})
)

// Post Sass to CSS process for addressing proprietary prefixes
//.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(
postcss([
// Boolean flag determines if CSS Custom Property code is in final output
// or only outputs legacy supported version CSS
postcssCustomProperties({
preserve: false,
}),

removeSelectors({
selectors: [':root'],
}),
])
)

// Output final CSS in destination
.pipe(gulp.dest('./altImports/canonical/'))
);
});

// task for Production Sass processing and legacy support
gulp.task('processImportsVariable', function() {
// set path to where Sass files are located to be processed
return (
gulp
.src('./src/*.scss')

// Sass pipeline
.pipe(
gulpSass({
errLogToConsole: true,
outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
})
)

// Post Sass to CSS process for addressing proprietary prefixes
//.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(
postcss([
removeSelectors({
selectors: [':root'],
}),
])
)

// Output final CSS in destination
.pipe(gulp.dest('./altImports/variable/'))
);
});
// // task for Production Sass processing and legacy support
// gulp.task('processImportsCanonical', function() {
// // set path to where Sass files are located to be processed
// return (
// gulp
// .src('./src/*.scss')

// // Sass pipeline
// .pipe(
// gulpSass({
// errLogToConsole: true,
// outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
// })
// )

// // Post Sass to CSS process for addressing proprietary prefixes
// //.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// // PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
// .pipe(
// postcss([
// // Boolean flag determines if CSS Custom Property code is in final output
// // or only outputs legacy supported version CSS
// postcssCustomProperties({
// preserve: false,
// }),

// removeSelectors({
// selectors: [':root'],
// }),
// ])
// )

// // Output final CSS in destination
// .pipe(gulp.dest('./altImports/canonical/'))
// );
// });

// // task for Production Sass processing and legacy support
// gulp.task('processImportsVariable', function() {
// // set path to where Sass files are located to be processed
// return (
// gulp
// .src('./src/*.scss')

// // Sass pipeline
// .pipe(
// gulpSass({
// errLogToConsole: true,
// outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
// })
// )

// // Post Sass to CSS process for addressing proprietary prefixes
// //.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// // PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
// .pipe(
// postcss([
// removeSelectors({
// selectors: [':root'],
// }),
// ])
// )

// // Output final CSS in destination
// .pipe(gulp.dest('./altImports/variable/'))
// );
// });

// task for Development Sass processing
gulp.task('processDev', function() {
Expand Down Expand Up @@ -211,23 +211,23 @@ gulp.task('processDev', function() {
);
});

// task for Development Sass processing
gulp.task('reprocessClean', function() {
// set path to where Sass files are located to be processed
return gulp.src('./altImports/**/*.scss')
// // task for Development Sass processing
// gulp.task('reprocessClean', function() {
// // set path to where Sass files are located to be processed
// return gulp.src('./altImports/**/*.scss')

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(postcss([
// // PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
// .pipe(postcss([

selectorReplace({
before: [":host", "&(:not(.is-touching))", "&(.focus-visible)"],
after: ["&", "&:not(.is-touching)", "&.focus-visible"],
})
]))
// selectorReplace({
// before: [":host", "&(:not(.is-touching))", "&(.focus-visible)"],
// after: ["&", "&:not(.is-touching)", "&.focus-visible"],
// })
// ]))

// Output final CSS in destination
.pipe(gulp.dest('./altImports/'));
});
// // Output final CSS in destination
// .pipe(gulp.dest('./altImports/'));
// });

// Sass watcher
gulp.task('sassWatch', function() {
Expand All @@ -242,13 +242,13 @@ gulp.task('sassWatch', function() {
gulp.task(
'build',
gulp.series(
gulp.parallel('copyFonts', 'buildTokens', 'processDemo', 'processSrc')
gulp.parallel('buildTokens', 'processDemo', 'processSrc')
)
);

gulp.task(
'dev',
gulp.series(
gulp.parallel('copyFonts', 'buildTokens', 'processDemo', 'processDev','sassWatch')
gulp.parallel('buildTokens', 'processDemo', 'processDev','sassWatch')
)
);
7 changes: 1 addition & 6 deletions template/package.temp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"autoprefixer": "^9.6.0",
"concat": "^1.0.3",
"copyfiles": "^2.1.0",
"css-byebye": "^2.0.0",
"focus-visible": "^4.1.5",
"gulp": "^4.0.1",
"gulp-autoprefixer": "^6.0.0",
Expand Down Expand Up @@ -107,11 +106,7 @@
"test:watch": "karma start --auto-watch=true --single-run=false",
"test:ci": "npm-run-all test lint",
"processSrc": "gulp processSrc",
"processImportsCanonical": "gulp processImportsCanonical",
"processImportsVariable": "gulp processImportsVariable",
"reprocessClean": "gulp reprocessClean",
"ciBuild": "npm-run-all buildTokens processSrc processImportsCanonical processImportsVariable stylefluxCanonical stylefluxVariable reprocessClean distTokens sassRender distJS",
"devBuild": "npm-run-all buildTokens processSrc distTokens sassRender distJS"
"ciBuild": "npm-run-all buildTokens processSrc distTokens sassRender distJS"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit ca09c2b

Please sign in to comment.