Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
glen-84 committed Oct 1, 2015
0 parents commit fe328dc
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See: http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = false

[*.{html,js,scss}]
indent_style = space
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
16 changes: 16 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test</title>
<!-- <link rel="stylesheet" href="/test.css" /> -->
<link rel="stylesheet" href="/app/styles/test2.css" />
</head>
<body>
<main class="container">
<button type="button" class="btn btn-primary">Primary</button>
</main>
</body>
</html>
46 changes: 46 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import gulp from "gulp";
import sourcemaps from "gulp-sourcemaps";
import sass from "gulp-sass";
import autoprefixer from "gulp-autoprefixer";
import browserSync from "browser-sync";

let bs = browserSync.create("bs-server");

let cssSrc = "src/**/*.scss";
let cssDest = "dist";

gulp.task("build-css", () => {
return gulp.src(cssSrc)
.pipe(sourcemaps.init({debug: true}))
.pipe(sass({
// See: https://github.com/sass/node-sass/issues/957
//outputStyle: "compressed"
outputStyle: "expanded"
}).on("error", sass.logError))
.pipe(autoprefixer({
// Default for Browserslist (https://github.com/ai/browserslist) @ 2015/09/18
browsers: ["> 1%", "last 2 versions", "Firefox ESR"]
}))
.pipe(sourcemaps.write(".", {debug: true}))
.pipe(gulp.dest(cssDest))
.pipe(browserSync.get("bs-server").stream({match: "**/*.css"}));
});

gulp.task("serve", ["build-css"], () => {
bs.init({
server: {
baseDir: "dist"
}
});
});

// Log file changes to the console.
function reportChange(event) {
console.log(`File ${event.path} was ${event.type}, running tasks...`);
};

gulp.task("watch", ["serve"], () => {
gulp.watch("src/**/*.scss", ["build-css"]).on("change", reportChange);
});

gulp.task("default", ["watch"]);
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"devDependencies": {
"babel": "^5.8.23",
"bootstrap": "git://github.com/twbs/bootstrap.git#v4.0.0-alpha",
"browser-sync": "^2.9.3",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
"gulp-sass": "^2.1.0-beta",
"gulp-sourcemaps": "^1.5.2"
}
}
3 changes: 3 additions & 0 deletions src/app/styles/test2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$brand-primary: green;

@import "../../../node_modules/bootstrap/scss/bootstrap.scss";
3 changes: 3 additions & 0 deletions src/test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$brand-primary: red;

@import "../node_modules/bootstrap/scss/bootstrap.scss";

0 comments on commit fe328dc

Please sign in to comment.