A modern Web starter kit for projects
Web Starter Kit (WSK) - is an opinionated boilerplate for web development. Tools for building a great experience across many devices. A solid starting point for both professionals and newcomers to the industry.
At present, we officially aim to support the last two versions of the following browsers:
This is not to say that WSK cannot be used in browsers older than those reflected, but merely that our focus will be on ensuring our layouts work great in the above.
|Easy start||We don't use responsive boilerplate. You are free to make your own decision in what way to make responsive for the site. Just start with |
|HTML templating||Used gulp-file-include for templating html files.|
|Sass support||Compile Sass into CSS with ease, bringing support for variables, mixins and more (run |
|PostCSS support||PostCSS connecting most usable plugins library for CSS optimisation. In our WSK we use autoprefixer, cssnano, postcss-sort-media-queries, etc.|
|Built-in HTTP Server||A built-in server for previewing your site locally while you develop and iterate.|
|Live Browser Reloading||Reload the browser in real-time anytime an edit is made without the need for an extension (run |
|Cross-device Synchronization||Synchronize clicks, scrolls, forms and live-reload across multiple devices as you edit your project. Powered by BrowserSync (run |
To get started please run
$ npm install
if you want use Gulp in global context please run
$ npm install --global gulp && npm install
To take advantage of WSK you need to:
This starter wasn't tested on Linux. If you want to use it on Ubuntu 17 type these commands in a command terminal:
$ sudo snap install node --classic --channel 6/stable
$ npm install gulpjs/gulp-cli -g
You can start from
src/html - the default starting point, with template text.
Be sure to look over the installation to verify your environment is prepared to run Web Starter Kit. Once you have verified that your system can run WSK, check out the commands available to get started.
Download and extract WSK to the place where you want to work.
Bring up a terminal and type
Node should respond with a version at or above 10.0.x.
If you need to install Node, go to nodejs.org and click on the big green Install button.
Bring up a terminal and type
If Gulp is installed it should return a version number at or above 4.0.x.
If you need to install/upgrade Gulp, open up a terminal and type in the following:
$ npm install --global gulp
This will install Gulp globally. Depending on your user account, you may need to configure your system to install packages globally without administrative privileges.
Next, install the local dependencies WSK requires:
$ npm install
That's it! You should now have everything needed to use the WSK.
You may also want to get used to some of the commands available.
There are few commands available to help you build and test sites:
Test run with logs
$ npm run test
Watch For Changes & Automatically Refresh Across Devices
$ npm run dev
dev creates the
assets folder in the root of the project.
This includes linting as well as image, script, stylesheet and HTML optimization.
Also, a browsersync script will be automatically generated, which will take care of precaching your sites resources.
Serve the Fully Built & Optimized Site
$ npm run build
build creates the
production folder in the root of the project with minifying files from
assets. It will help you to create clear instances of code for the production or further implementation.
$ npm run lint-html
$ npm run lint-js
lint-js run the separate lint for JS files.
$ npm run fix-js
fix-js run lint and auto-fix (eslint method) for JS files.
Not included in any mode.
$ npm run lint
If you want to use our WSK, you need to know something about the structure.
Your folder structure for WSK:
├── assets #Folder with files after compiling ├── helpers #Folder with helpers function for tasks ├── src #Folder with sources ├── system_files #Folder with system files ├── tasks #Folder with tasks for gulpfile ├── .babelrc #Config for Babel ├── .browserslistrc #Config for autoprefixer ├── .editorconfig #Config for IDE ├── .eslintignore #Eslint ignore list ├── .eslintrc #Config for eslint ├── .gitattributes #Git config for defining attributes per path ├── .gitignore #Git ignore list ├── .htaccess #Config file of Apache web service ├── .travis.yml #Config file of service for building and testing projects hosted at GitHub ├── CONTRIBUTING.md ├── gulp-config.js #Config for gulp ├── gulpfile.js #File with gulp tasks ├── LICENSE ├── package.json #File with dependencies └── README.md
package.json you can find all the dependencies. Folder
tasks - for gulpfile tasks. In
├── html ├── partials #Folder for html components, that we can include into the templates ├── templates #Folder for source html templates of pages ├── images #Folder for storing images ├── js #Folder for storing js files ├── modules #Folder for storing js modules ├── app.js #Main js file ├── scss ├── abstracts #Folder for storing scss files ├── functions.scss #Sass functions ├── helpers.scss #Style helpers ├── main.scss #Main file to import abstracts styles (used for importing another files) ├── mixins.scss #Sass mixins ├── variables.scss #Sass variables & CSS custom properties that we can use in project ├── base #Folder for storing base styles ├── forms.scss #Styles for forms ├── main.scss #Main file to import base styles (used for importing another files) ├── reset.scss #Styles reset ├── typography.scss #Styles for text ├── components #Global Reusable Presentational Components ├── layout #Global layout ├── pages #Global styles for pages ├── styles.scss #Main file to import project styles (used for importing another files) ├── vendor_entries #Folder for vendor entries (plugins) ├── vendor.scss #File for plugins styles
images folder to add your graphic files,
scss folder to add your styles for the project. You can create, delete files and folders in
scss, but don't forget to include them in
vendor_entries to include plugins into your project.
For linting html files in WSK used HTMLHint.
Sass is a CSS preprocessor — a layer between the stylesheets you author and the .css files you serve to the browser. Sass (short for Syntactically Awesome Style Sheets) plugs the holes in CSS as a language, allowing you to write DRY code that’ll be faster, more efficient, and easier to maintain. In our WSK we follow Sass guidelines.
So while normal CSS doesn’t yet allow things like variables, mixins (reusable blocks of styles), and other goodies, Sass provides a syntax that does all of that and more—enabling “super functionality” in addition to your normal CSS.
src/scss/styles.scssyou can import all your
.scssfiles from here;
You are able to add your own custom sass files and optionally disable/enable postcss-sort-media-queries.
You can see this property
getFilesForStylesCustom in the
Please don't forget to link all your styles custom files in html file:
Also, you might want to add files to the ignore list (check
getFilesToCopy properties in the
gulp-config.js file). By default they will be copied to the
-webkitit will be done by the autoprefixer.
In build (production) mode we use:
desktop-firstsorting type, but you can change it in
.cssfiles by cssnano.
In our WSK we use CSS3 custom properties and relative units
rem. By default
1rem = 10px.
src/vendor_entries, are automatically separate in
In build (production) mode we use:
.jsfiles by terser.
gulp by default gulp watching for your files in
vendors_entries folders after change in included files, watcher run they tasks for compiling. For
images and other folders (and files in
src root) watcher run tasks for copy files & reload browser.
In our WSK by default in development and build (production) mode, task
build-images only copy images.
For minify images used gulp-imagemin. If you want to minify your images in build (production) mode, please switch option
buildImages.isImageMin = true in
|browser-sync-server||Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS & images) or will cause all browsers to do a full-page refresh.|
|build-html||Compiles all html templates into html files.|
|build-js||Compiles all js from |
|build-styles||Compiles all scss from |
|build-styles-custom||Compiles all custom scss files listed in the |
|build-styles-vendors||Compiles all vendor styles from |
|clean-build||Cleaning folders for output files.|
|copy-files||Copy all not compiling files & folders from |
|copy-files-production||Copy all files & folders from |
|lint-html||Need to lint html files.|
|lint-js||Need to lint & fix js files.|
|build-images||We use this to copy images & minify for production.|
|watch||Task for watching all the changes.|
Contributions, questions and comments are all welcome and encouraged. For code contributions to Web Starter Kit, please see our Contribution guide before submitting a pull request. Website related issues should be filed on the Web Fundamentals issue tracker.
The MIT License (MIT).
Copyright (c) 2020 JustCoded the IP provided on other devices on your network.