Software for Bootstrap

Just after PHP course on Udemy I’ve started to learn Bootstrap. That’s a nice set of tools for quick web page creation. You can use ready  classes for html elements, make cool navigation bars and even use javascript functions for simple actions. After playing with css manually I can assure you that Bootstrap is extremely helpful.

For quick coding I’m using the following apps:

  • Node.js – this is sass preprocessor that allows you to use constants and flexible targeting in css. I’m using the following js file to create ready to go working folder with bootstrap with Node.js
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');

// Compile Sass & Inject Into Browser
gulp.task('sass', function(){
  return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss','src/scss/*.scss'])
    .pipe(sass())
    .pipe(gulp.dest("src/css"))
    .pipe(browserSync.stream());
});

// Move JS Files to src/js
gulp.task('js', function(){
  return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js','node_modules/jquery/dist/jquery.min.js','node_modules/popper.js/dist/umd/popper.min.js'])
    .pipe(gulp.dest("src/js"))
    .pipe(browserSync.stream());
});

// Watch Sass & Server
gulp.task('serve', ['sass'], function(){
  browserSync.init({
    server: "./src"
  });

  gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], ['sass']);
  gulp.watch("src/*.html").on('change', browserSync.reload);
});

// Move Fonts Folder to src/fonts
gulp.task('fonts', function(){
  return gulp.src('node_modules/font-awesome/fonts/*')
    .pipe(gulp.dest("src/fonts"));
});

// Move Font Awesome CSS to src/css
gulp.task('fa', function(){
  return gulp.src('node_modules/font-awesome/css/font-awesome.min.css')
    .pipe(gulp.dest("src/css"));
});

gulp.task('default', ['js', 'serve', 'fa', 'fonts']);

Atom editor – nice looking editor with the options to install packages and themes to speed up typing. I’m using packages emmet for shortcuts and atom-life-server for auto update page in browser after saving code in editor

Leave a Comment