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

Update gulpfile.js #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const pug = require('gulp-pug');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
const htmlbeautify = require('gulp-html-beautify');
const autoprefixer = require('gulp-autoprefixer');
const server = require('browser-sync').create();
const del = require('del');

Expand Down Expand Up @@ -38,6 +39,14 @@ var paths = {
src: 'src/images/**/*',
dest: 'dist/images/'
},
icons: {
src: 'src/icons/**/*',
dest: 'dist/icons/'
},
fonts: {
src: 'src/fonts/**/*',
dest: 'dist/fonts/'
},
all: {
src: 'src/**/*',
}
Expand All @@ -54,6 +63,18 @@ function copyScripts() {
.pipe(gulp.dest(paths.scripts.dest));
}

function copyIcons() {
return gulp.src(paths.icons.src)
.pipe(gulp.dest(paths.icons.dest));
cb();
}

function copyFonts() {
return gulp.src(paths.fonts.src)
.pipe(gulp.dest(paths.fonts.dest));
cb();
}

function clean(cb) {
exports.clean = del.bind(null, ['dist']);
cb();
Expand All @@ -69,21 +90,27 @@ function templates() {
function styles() {
return gulp.src(paths.styles.src)
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(paths.styles.dest));
}

function watch() {
gulp.watch(paths.all.src, gulp.series(gulp.parallel(templates, styles, copyImages, copyScripts), reload));
gulp.watch(paths.all.src, gulp.series(gulp.parallel(templates, styles, copyImages, copyScripts, copyFonts, copyIcons), reload));
}

// Expose individual functions as gulp tasks for debugging purposes
exports.templates = templates;
exports.copyImages = copyImages;
exports.copyScripts = copyScripts;
exports.copyIcons = copyIcons;
exports.copyFonts= copyFonts;
exports.clean = clean;
exports.watch = watch;
exports.styles = styles;

// Export our defaults
exports.default = gulp.series(clean, gulp.parallel(templates, styles, copyImages, copyScripts), serve, watch);
exports.build = gulp.series(clean, gulp.parallel(templates, styles, copyImages, copyScripts));
exports.default = gulp.series(clean, gulp.parallel(templates, styles, copyImages, copyScripts, copyIcons, copyFonts), serve, watch);
exports.build = gulp.series(clean, gulp.parallel(templates, styles, copyImages, copyScripts, copyIcons, copyFonts));
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"devDependencies": {
"browser-sync": "^2.24.7",
"gulp": "^4.0.0",
"gulp-autoprefixer": "^6.0.0",
"gulp-pug": "^4.0.1",
"gulp-rename": "^1.4.0",
"gulp-sass": "^4.0.1"
Expand Down
Binary file added src/fonts/inter-ui-medium.otf
Binary file not shown.
Binary file added src/fonts/inter-ui-medium.ttf
Binary file not shown.
Binary file added src/fonts/inter-ui-medium.woff
Binary file not shown.
Binary file added src/fonts/inter-ui-medium.woff2
Binary file not shown.
Binary file added src/fonts/inter-ui-regular.otf
Binary file not shown.
Binary file added src/fonts/inter-ui-regular.ttf
Binary file not shown.
Binary file added src/fonts/inter-ui-regular.woff
Binary file not shown.
Binary file added src/fonts/inter-ui-regular.woff2
Binary file not shown.
Binary file added src/fonts/inter-ui.var.woff2
Binary file not shown.
3 changes: 3 additions & 0 deletions src/icons/sample.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion src/scss/screen.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
@font-face {
font-family: 'Inter UI';
font-style: normal;
font-weight: 400;
src: url('/fonts/inter-ui.var.woff2') format("woff2-variations"),
url("/fonts/inter-ui-regular.woff2") format("woff2"),
url("/fonts/inter-ui-regular.woff") format("woff");
}

@font-face {
font-family: 'Inter UI';
font-style: normal;
font-weight: 500;
src: url('/fonts/inter-ui.var.woff2') format("woff2-variations"),
url("/fonts/inter-ui-medium.woff2") format("woff2"),
url("/fonts/inter-ui-medium.woff") format("woff");
}

body {
background: #FFF;
font-family: sans-serif;
font-family: "Inter UI", sans-serif;
}