Git Product home page Git Product logo

bootstrap-genesis's Introduction

bootstrap-genesis

WordPress Genesis Child Theme setup to use Bootstrap 3, Sass, and Grunt.

Contributors

@salcode, @dustyndoyle, @codenameEli, @bryanwillis, @michaelcarwile

The CSS is Missing

I hear from a lot of users, "Hey, I tried to use your theme but there is no CSS."

Quick Fix

Download the latest Bootstrap Genesis release and use that.

The Long Version

This is the base theme I use for the projects I build. Part of my workflow includes using GruntJS for my CSS/Sass and JavaScript compilation, concatenation, and minification. Because the resulting css/style.min.css and js/javascript.min.js files are compiled files, I do NOT check them into version control (i.e. they are listed in the .gitignore file).

The result of all this is the files in the repo are a copy of the theme with all the source files for the CSS and JavaScript but not the final CSS and JavaScript.

If you're running GruntJS and have Sass installed you can run npm install and grunt from the command line and the CSS and JavaScript will be generated. If you're not running these tools yet, you can use the latest Bootstrap Genesis release, which includes the compilied CSS and JavaScript.

Why no CSS in style.css?

Since I'm treating the CSS as a compiled asset that I do not want to include it in version control, I use style.css only for the theme header information and all applied CSS is stored in css/style.min.css

Override/Customize as a 'grandchild' theme

This repo will ignore these files, so if you want them tracked you'll need to setup a repo inside the custom directory and track it separately - either as a submodule or a subtree. The Gruntfile will look for directory structure that looks like this:

custom/css
custom/lib
custom/js

Copypasta (while in the root bootstrap-genesis directory):

mkdir -p custom/{css,lib,js}
touch custom/{css/custom.scss,lib/custom-functions.php,js/custom.js}

Using grunt build scripts and project setup

Machine Setup NOTE: Machine Setup must have occurred at lease once previously on this machine:

Install nodejs from http://nodejs.org/download/ or, if on Linux (Ubuntu/Debian):
sudo apt-get install -y nodejs-legacy

NOTE: nodejs-legacy is required as node causes build errors.

From the command line install grunt cli
sudo npm install -g grunt-cli

From the commdand line install sass
sudo gem install sass

Install grunt for this project (generates ./node_modules).
Run from within this directory (bootstrap-genesis):
npm install

-- Machine Setup Complete

Run grunt to build initial scripts and styles:
grunt

NOTE: see Gruntfile.js for more options related to grunt.

Menu Modifications

The menu is modified to use Bootstrap markup and the menus are placed at the top of the page by default. All menu modifications are removed, when the Ubermenu plugin is present

Project Goal

This theme was created as my own starting point when building custom Genesis child themes using the Bootstrap front-end framework.

The goal is to leverage Bootstrap as much as possible by adding the appropriate markup to trigger Bootstrap styling.

Whenever there is a choice between making an adjustment via the markup or via Sass/CSS, markup modifications are preferrable. There are two justifications for this:

  1. We want to keep the CSS as small as possible for load time
  2. By using Bootstrap Markup we make the Bootstrap integration more transparent and easier understand and manipulate.

How to Update Bootstrap

Here are my notes on updating Bootstrap in this project.

Warning

After updating the Bootstrap files, the Grunt task must be run to update css/style.min.css and js/javascript.min.js. There are the only two files loaded for CSS and JavaScript, all of the other files are the source files which are used to create these two minified files.

Steps

  • Download the latest Sass version of Bootstrap
  • Replace the JavaScript file. Move the new assets/javascripts/bootstrap.js to js/vendor/bootstrap/
  • Replace the fonts. Move all files in the new download from assets/fonts/bootstrap/ to fonts/bootstrap/
  • Replace the top level Sass file. Move the new assets/stylesheets/_bootstrap.scss to css/sass/supporting/bootstrap.scss
  • Replace the Bootstrap partial and mixin files. Mall all files in the new download from assets/stylesheets/bootstrap/ to css/sass/supporting/bootstrap/

License

GPL

bootstrap-genesis's People

Contributors

salcode avatar saldm avatar bryanwillis avatar michaelcarwile avatar launchdm-dustyn avatar elidalbey avatar codenameeli avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.