-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from uswds/develop
Public Sans v2.001
- Loading branch information
Showing
164 changed files
with
8,416 additions
and
4,504 deletions.
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 |
---|---|---|
@@ -1 +1 @@ | ||
14 | ||
16 |
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 @@ | ||
3.0.2 |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ source "https://rubygems.org" | |
|
||
gem "jekyll", ">= 4.1.1" | ||
gem "thin" | ||
gem "webrick", "~> 1.7" |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,205 +1,43 @@ | ||
/* | ||
* * * * * ============================== | ||
* * * * * ============================== | ||
* * * * * ============================== | ||
* * * * * ============================== | ||
======================================== | ||
======================================== | ||
======================================== | ||
---------------------------------------- | ||
USWDS SASS GULPFILE | ||
---------------------------------------- | ||
*/ | ||
const { src, dest, series, parallel, watch } = require("gulp"); | ||
const uswds = require("@uswds/compile"); | ||
|
||
const autoprefixer = require("autoprefixer"); | ||
const csso = require("postcss-csso"); | ||
const gulp = require("gulp"); | ||
const pkg = require("./node_modules/uswds/package.json"); | ||
const postcss = require("gulp-postcss"); | ||
const replace = require("gulp-replace"); | ||
const sass = require("gulp-sass"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
const uswds = require("./node_modules/uswds-gulp/config/uswds"); | ||
const del = require("del"); | ||
const svgSprite = require("gulp-svg-sprite"); | ||
const rename = require("gulp-rename"); | ||
uswds.settings.version = 3; | ||
uswds.paths.src.projectSass = "./site/_sass"; | ||
uswds.paths.dist.img = "./site/assets/uswds/img"; | ||
uswds.paths.dist.fonts = "./site/assets/uswds/fonts"; | ||
uswds.paths.dist.js = "./site/assets/uswds/js"; | ||
uswds.paths.dist.css = "./site/assets/css"; | ||
uswds.paths.dist.theme = "./site/_sass"; | ||
|
||
// Required for "watch-webfonts" task. | ||
const watch = require("gulp-watch"); | ||
|
||
sass.compiler = require("sass"); | ||
|
||
/* | ||
---------------------------------------- | ||
PATHS | ||
---------------------------------------- | ||
- All paths are relative to the | ||
project root | ||
- Don't use a trailing `/` for path | ||
names | ||
---------------------------------------- | ||
*/ | ||
|
||
// Project Sass source directory | ||
const PROJECT_SASS_SRC = "./site/_sass"; | ||
|
||
// Images destination | ||
const IMG_DEST = "./site/assets/uswds/img"; | ||
|
||
// Fonts destination | ||
const FONTS_DEST = "./site/assets/uswds/fonts"; | ||
|
||
// Javascript destination | ||
const JS_DEST = "./site/assets/uswds/js"; | ||
|
||
// Compiled CSS destination | ||
const CSS_DEST = "./site/assets/css"; | ||
|
||
// Webfonts | ||
const WEBFONTS_SRC = "./fonts/webfonts"; | ||
const WEBFONTS_DEST = "./site/assets/fonts"; | ||
|
||
/* | ||
---------------------------------------- | ||
TASKS | ||
---------------------------------------- | ||
*/ | ||
|
||
gulp.task("copy-uswds-setup", () => { | ||
return gulp | ||
.src(`${uswds}/scss/theme/**/**`) | ||
.pipe(gulp.dest(`${PROJECT_SASS_SRC}`)); | ||
}); | ||
|
||
gulp.task("copy-uswds-fonts", () => { | ||
return gulp.src(`${uswds}/fonts/**/**`).pipe(gulp.dest(`${FONTS_DEST}`)); | ||
}); | ||
|
||
gulp.task("copy-uswds-images", () => { | ||
return gulp.src(`${uswds}/img/**/**`).pipe(gulp.dest(`${IMG_DEST}`)); | ||
}); | ||
|
||
gulp.task("copy-uswds-js", () => { | ||
return gulp.src(`${uswds}/js/**/**`).pipe(gulp.dest(`${JS_DEST}`)); | ||
}); | ||
|
||
gulp.task("build-sass", function (done) { | ||
var plugins = [ | ||
// Autoprefix | ||
autoprefixer({ | ||
cascade: false, | ||
grid: true, | ||
}), | ||
// Minify | ||
csso({ forceMediaMerge: false }), | ||
]; | ||
return gulp | ||
.src([`${PROJECT_SASS_SRC}/*.scss`]) | ||
.pipe(sourcemaps.init({ largeFile: true })) | ||
.pipe( | ||
sass.sync({ | ||
includePaths: [ | ||
`${PROJECT_SASS_SRC}`, | ||
`${uswds}/scss`, | ||
`${uswds}/scss/packages`, | ||
], | ||
}) | ||
) | ||
.pipe(replace(/\buswds @version\b/g, "based on uswds v" + pkg.version)) | ||
.pipe(postcss(plugins)) | ||
.pipe(sourcemaps.write(".")) | ||
.pipe(gulp.dest(`${CSS_DEST}`)) | ||
.pipe(gulp.dest("./_site/assets/css")); | ||
}); | ||
function copyWebfonts() { | ||
return src(`${WEBFONTS_SRC}/**/**`) | ||
.pipe(dest(WEBFONTS_DEST)); | ||
} | ||
|
||
// SVG sprite configuration | ||
config = { | ||
shape: { | ||
dimension: { // Set maximum dimensions | ||
maxWidth: 24, | ||
maxHeight: 24 | ||
}, | ||
id: { | ||
separator: "-" | ||
}, | ||
spacing: { // Add padding | ||
padding: 0 | ||
} | ||
}, | ||
mode: { | ||
symbol: true // Activate the «symbol» mode | ||
} | ||
function watchWebfonts() { | ||
return watch(`${WEBFONTS_SRC}/**/*`, copyWebfonts); | ||
}; | ||
|
||
gulp.task("build-sprite", function (done) { | ||
gulp.src(`${IMG_DEST}/usa-icons/**/*.svg`, { | ||
allowEmpty: true, | ||
}) | ||
.pipe(svgSprite(config)) | ||
.on("error", function (error) { | ||
console.log("There was an error"); | ||
}) | ||
.pipe(gulp.dest(`${IMG_DEST}`)) | ||
.on("end", function () { | ||
done(); | ||
}); | ||
}); | ||
|
||
gulp.task("rename-sprite", function (done) { | ||
gulp.src(`${IMG_DEST}/symbol/svg/sprite.symbol.svg`, { | ||
allowEmpty: true, | ||
}) | ||
.pipe(rename(`${IMG_DEST}/sprite.svg`)) | ||
.pipe(gulp.dest(`./`)) | ||
.on("end", function () { | ||
done(); | ||
}); | ||
}); | ||
|
||
gulp.task("clean-sprite", function (cb) { | ||
cb(); | ||
return del.sync(`${IMG_DEST}/symbol`); | ||
}); | ||
|
||
gulp.task( | ||
"init", | ||
gulp.series( | ||
"copy-uswds-setup", | ||
"copy-uswds-fonts", | ||
"copy-uswds-images", | ||
"copy-uswds-js", | ||
"build-sass" | ||
) | ||
); | ||
|
||
gulp.task("copy-webfonts", () => { | ||
return gulp.src(`${WEBFONTS_SRC}/**/**`).pipe(gulp.dest(WEBFONTS_DEST)); | ||
}); | ||
|
||
gulp.task("watch-webfonts", () => { | ||
gulp | ||
.src(`${WEBFONTS_SRC}/**/*`, { base: WEBFONTS_SRC }) | ||
.pipe(watch(WEBFONTS_SRC, { base: WEBFONTS_SRC })) | ||
.pipe(gulp.dest(WEBFONTS_DEST)); | ||
}); | ||
|
||
|
||
gulp.task("watch-sass", function () { | ||
gulp.watch(`${PROJECT_SASS_SRC}/**/*.scss`, gulp.series("build-sass")); | ||
}); | ||
|
||
gulp.task( | ||
"watch", | ||
gulp.series( | ||
"copy-webfonts", | ||
"build-sass", | ||
gulp.parallel("watch-sass", "watch-webfonts") | ||
exports.watch = series( | ||
copyWebfonts, | ||
uswds.compile, | ||
parallel( | ||
uswds.watch, | ||
watchWebfonts | ||
) | ||
); | ||
|
||
gulp.task("default", gulp.series("watch")); | ||
|
||
gulp.task( | ||
"svg-sprite", | ||
gulp.series("build-sprite", "rename-sprite", "clean-sprite") | ||
); | ||
exports.compileIcons = uswds.compileIcons; | ||
exports.copyWebfonts = copyWebfonts; | ||
exports.copyFonts = uswds.copyFonts; | ||
exports.copyImages = uswds.copyImages; | ||
exports.copyJS = uswds.copyJS; | ||
exports.copyTheme = uswds.copyTheme; | ||
exports.copyAssets = uswds.copyAssets; | ||
exports.update = series(uswds.copyImages, uswds.copyJS); | ||
exports.buildSass = uswds.compile; | ||
exports.watchSass = uswds.watch; | ||
exports.default = this.watch; |
Oops, something went wrong.