Twitter Bootstrap is front-end framework which can be used to create mockups or a small website. To customize and create a quick single page website you need to possess following skills.

  • HTML, CSS, JavaScript
  • Photoshop
  • Less CSS preprocessor.
  • NodeJs & Grunt

Website requirements Wire-framing

  • So we want to use twitter bootstrap existing template and modify it.
  • Each page will be full height page, that fits completely into view port.
  • Use animating effect while clicking navbar link and reach to the target section on the page.
  • Make top navigation bar fixed.
  • Use scroll spy that indicate current page on fix navigation bar.
  • Customize native bootstrap theme using grunt and less with our requirements.

Quickly customizing Twitter Bootstrap

  • Download and install nodejs.
  • Once nodejs is installed – install grunt (javascript task runner).
  • Download twitter bootstrap source archive (not dist zip)

Testing Your Setup

  • Open command line and navigate to extracted bootstrap source directory.
  • Run command : grunt

grunt-verify

If every thing runs fine, you are not ready to create website. Now navigate and open \examples\carousel\index.html in your browser. This page will look like this.

Twitter Bootstrap customization.

Customizing look at feel of navbar is easy. It’s quickly done using less-css and grunt.  First, open /less/variables.less

customizing background color and font.

find // Scaffolding and set your colors, I set here black color.

Now run grunt command and refresh the page.

customizing top navbar

and find // Navbar section. See the variables and customize them.

I changed default navbar height from 50px to 30px and default background color to yellow (#FDD922).

Now run grunt command and refresh the page.

Changing Button colors

find line // Buttons and change variables below as per your requirements.

JavaScript Customization

Making each page section full height of viewport

Assign class=”fullsize” to each section and then call below code using jQuery.

 Making bootstrap carousel align middle of the view port.

 Making navbar links smooth scroll to target element.

 Making bootstrap navbar to use scrollspy feature.

Final outcome and making single page website live.

  • Run grunt command to save above changes
  • Upload your index.html file to your web-server.
  • upload contents of /dist directory to doc-root of your web-server. (Note:- css, js and fonts directory)
  • Change the path of bootstrap js and css as follow
  • Navigate your site and test it. Check my final outcome

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment