This repository has been archived by the owner on Dec 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Build: add jsass-vars and completely modularize grunt #89
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ style.css | |
# Folders | ||
bower_components/ | ||
node_modules/ | ||
external/ | ||
icons/svg-min/ | ||
.sass-cache/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
"trailing": true, | ||
"undef": true, | ||
"unused": true, | ||
|
||
"globals": { | ||
"define": true | ||
}, | ||
"node": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,199 +1,10 @@ | ||
module.exports = function( grunt ) { | ||
require( "load-grunt-tasks" )( grunt ); | ||
|
||
var config = { | ||
htmllint: { | ||
dist: { | ||
options: {}, | ||
src: [ "demos/*.html" ] | ||
} | ||
}, | ||
autoprefixer: { | ||
dist: { | ||
options: { | ||
map: true, | ||
browsers: [ | ||
"> 1%", | ||
"last 2 versions", | ||
"safari >= 5.1", | ||
"ios >= 6.1", | ||
"android 2.3", | ||
"android >= 4", | ||
"ie >= 8" | ||
] | ||
}, | ||
src: "dist/css/*.css" | ||
} | ||
}, | ||
csscomb: { | ||
dist: { | ||
files: { | ||
"dist/css/chassis.css": "dist/css/chassis.css" | ||
} | ||
}, | ||
scss: { | ||
files: [ { | ||
expand: true, | ||
src: [ "scss/**/*.scss" ] | ||
} ] | ||
} | ||
}, | ||
cssmin: { | ||
options: { | ||
report: "gzip", | ||
sourceMap: true | ||
}, | ||
target: { | ||
files: { | ||
"dist/css/chassis.min.css": "dist/css/chassis.css" | ||
} | ||
} | ||
}, | ||
csslint: { | ||
src: [ "dist/css/chassis.lint.css", "dist/css/chassis.lint.css", "demos/demos.css" ] | ||
}, | ||
jscs: { | ||
all: [ "*.js", "performance/**/*.js" ] | ||
}, | ||
jshint: { | ||
files: [ "*.js", "performance/**/*.js" ], | ||
options: { | ||
jshintrc: ".jshintrc" | ||
} | ||
}, | ||
npmcopy: { | ||
options: { | ||
destPrefix: "external" | ||
}, | ||
normalize: { | ||
files: { | ||
"normalize.css/LICENSE.md": "normalize.css/LICENSE.md", | ||
"normalize.css/normalize.scss": "normalize.css/normalize.css" | ||
} | ||
} | ||
}, | ||
sass: { | ||
|
||
// This is the same as lint below except including normalize.css | ||
dist: { | ||
options: { | ||
sourceMap: true, | ||
|
||
// This actually does nested until libsass updates to support expanded | ||
outputStyle: "expanded" | ||
}, | ||
files: { | ||
"dist/css/chassis.css": "scss/style.scss" | ||
} | ||
}, | ||
|
||
// This is everything except normalize.css which won't pass our lint settings | ||
lint: { | ||
options: { | ||
sourceMap: true, | ||
|
||
// This actually does nested until libsass updates to support expanded | ||
outputStyle: "expanded" | ||
}, | ||
files: { | ||
"dist/css/chassis.lint.css": "scss/lint.scss" | ||
} | ||
} | ||
}, | ||
|
||
// Minifies SVGs | ||
svgmin: { | ||
options: { | ||
plugins: [ | ||
{ | ||
removeViewBox: false | ||
}, | ||
{ | ||
removeUselessStrokeAndFill: false | ||
} | ||
] | ||
}, | ||
dist: { | ||
files: [ { | ||
expand: true, | ||
cwd: "icons/svg-source", | ||
src: [ "*.svg" ], | ||
dest: "icons/svg-min/", | ||
ext: ".svg" | ||
} ] | ||
} | ||
}, | ||
|
||
// Combines SVGs into single file | ||
svgstore: { | ||
defaults: { | ||
options: { | ||
|
||
// This will prefix each ID | ||
prefix: "icon-", | ||
|
||
// Adds attributes to the resulting SVG | ||
svg: { | ||
viewBox: "0 0 24 24", | ||
xmlns: "http://www.w3.org/2000/svg" | ||
}, | ||
cleanup: [ "style", "fill", "id" ] | ||
}, | ||
files: { | ||
"icons/icons.svg": [ "icons/svg-min/*.svg" ] | ||
} | ||
} | ||
}, | ||
watch: { | ||
sass: { | ||
files: [ "scss/**/*.scss" ], | ||
tasks: [ "build" ], | ||
options: { | ||
spawn: false | ||
} | ||
}, | ||
svg: { | ||
files: [ "svg-source/**/*.svg" ], | ||
tasks: [ "svg" ], | ||
options: { | ||
spawn: false | ||
} | ||
} | ||
}, | ||
"stop-selenium-server": { | ||
dev: {} | ||
} | ||
}; | ||
|
||
// This loads files in the options folder as task options | ||
// and builds an object based on their file names | ||
function loadConfig(path) { | ||
var glob = require( "glob" ), | ||
object = {}, | ||
key; | ||
|
||
glob.sync( "*", { cwd: path } ).forEach( function( option ) { | ||
key = option.replace( /\.js$/, "" ); | ||
object[ key ] = require( path + option ); | ||
}); | ||
|
||
return object; | ||
} | ||
|
||
// We no combine the loaded task options with the ones defined in config above | ||
grunt.util._.extend( config, loadConfig( "./tasks/options/" ) ); | ||
|
||
grunt.initConfig( config ); | ||
grunt.loadTasks( "tasks" ); | ||
grunt.loadNpmTasks( "perfjankie" ); | ||
grunt.registerTask( "default", [ "test" ] ); | ||
grunt.registerTask( "test", [ "build", "jshint", "jscs", "csslint", "htmllint" ] ); | ||
grunt.registerTask( "build", [ "svg", "sass", "csscomb", "cssmin" ] ); | ||
grunt.registerTask( "perf", [ | ||
"start-selenium-server", | ||
"connect:perf", | ||
"perfjankie", | ||
"stop-selenium-server" | ||
]); | ||
grunt.registerTask( "svg", [ "svgmin", "svgstore" ] ); | ||
var path = require( "path" ); | ||
require( "load-grunt-config" )( grunt, { | ||
configPath: [ | ||
path.join( process.cwd(), "tasks/options" ), | ||
path.join( process.cwd(), "tasks" ) | ||
], | ||
init: true | ||
} ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ module.exports = { | |
], | ||
icon: [ | ||
false, | ||
"asterisk", | ||
"astrisk", | ||
"plus", | ||
"minus", | ||
"euro", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
// ========================================================================== | ||
// CSS Chassis | ||
// ========================================================================== | ||
// This just adds normalize to the build see lint.scss for explanation. | ||
|
||
@import | ||
"external/normalize.css/normalize.scss", | ||
"lint.scss"; | ||
"_utilities/clearfix"; | ||
|
||
@import | ||
"atoms/icons/icons", | ||
"atoms/typography/typography"; | ||
|
||
@import | ||
"views/main"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This is just boiuler plate dont worry about it | ||
// This just supports loading in any enviroment | ||
( function( root, factory ) { | ||
if ( typeof define === "function" && define.amd ) { | ||
define( [], factory ); | ||
} else if ( typeof exports === "object" ) { | ||
module.exports = factory(); | ||
} else { | ||
root.chassis = factory(); | ||
} | ||
}( this, function() { | ||
return {}; | ||
} ) ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this switched to an older version of grunt-sass?