How to get started with Goodkit!
This guide will help you get started with Goodkit! All the important stuff β compiling the source, file structure, build tools, file includes β is documented here, but should you have any questions, always feel free to reach out to support@goodthemes.co.
Goodkit extends Bootstrap by not only building on top of its existing components, but also introducing entirely new components and plugins. The best way to get an overview of this is to run through the components.html page.
To get started, you need to do the following:
npm install
: Open your command line to the root directory of your unzipped theme and run to install all of Goodkit's dependencies.
It's that simple! If you're not used to using terminal, don't worry, this is as advanced as it gets. If you want to kill the server and stop webpack, just hit Control + C
.
Webpack is used to manage Goodkit development. Open your command line to the root directory of the theme to use the following commands:
npm start
: Compile and watch the SCSS/JS/HTML, use Live Reload to update browsers instantly, start a server, and pop a tab in your default browser. Any changes made to the source files will be compiled as soon as you save the file.
npm run build
: Generates a /dist
directory with all the production files.
npm
installs dependencies
The handlebars-webpack-plugin package is used to make partials easier to use for initial development. For Goodkit, we only use it for a handful of components that are found on most pages. The most important partials available are:
footer.html
classList (string)
- Parameter for passing additional classnames
head.html
title (string)
- Parameter for the page title
modals.html
navbar.html
classList (string)
- Parameter for passing additional classnames
script.html
Easily create new .html
partials inside the /partials
folder and point to them
from any file by specifying the path to the partial file inside {{> }}
curly brackets.
Please read the official package documentation for more info.
There are 2 basic ways to customize your theme...
webpack
compilation steps outlined above. The 2 major benefits of this strategy are using variable overrides to easily customize theme styles, plus you never have to touch Bootstrap or Goodkit's source, meaning future updates will be much, much, simpler. There are 2 provided files that make this strategy simple to implement:
user-variables.scss
: This file can be used to override Bootstrap core and Goodkit variables for customizing elements that have been tied to variables.
user.scss
: This file can be used for writing custom SCSS that will be compiled alongside Bootstrap and Goodkit's core files.
theme.bundle.css
file in the dist/assets/css
directory.