Foundation

Installing the Compass Gem

Start using Foundation the way you want, with more control than ever before. We've made it really easy to install using Compass so you'll need a little bit of knowledge before you get going. Visit the Compass and Sass sites to learn the basics if you don't already know them.

Recommended Installation

To create your first project using our Compass extension, you'll need to have the zurb-foundation gem installed. This will install Foundation and all necessary dependencies. Here's the command that will do this for you:

[sudo] gem install zurb-foundation


Note: Make sure ZURB isn't all caps.

Upgrading Your Gem

To upgrade your gem to the latest public release, just paste this snippet into your command line:

[sudo] gem update zurb-foundation

Release Candidates

Stay on top of the latest before official releases by installing release candidates with this command:

[sudo] gem install zurb-foundation --pre


Compiling Your Scss

To compile your Scss into CSS you run a simple command that will watch for saves and compile each time you save an Scss file. The command is:

compass watch



Creating your first project

Compass makes it really easy to start a new project. Since you've installed the Foundation gem by now, you now have Compass, Sass and a few other necessary dependencies available at your fingertips.

Follow these two steps to get going:

  1. cd path/to/where-you-want-your-project
  2. run compass create <project-name> -r zurb-foundation --using foundation

Working with Existing projects

There are a couple situations to cover here. You might be adding Foundation to an existing project that wasn't build with Foundation or you might be upgrading Foundation for an already created Foundation Compass project.
Adding Foundation to existing Compass projects

If you've created a project using Compass, but didn't require the Foundation gem, you'll need to install it separately. When you do this you'll get all the necessary files on top of the ones you already have. If something is a duplicate, Compass will ignore it. The steps you'll take to properly install Foundation are:

  1. Add require "zurb-foundation" to your config.rb file
  2. cd path/to/your-project
  3. run compass install foundation
Upgrading Foundation Compass projects

Javascript and Image Updates: If you already added Foundation to your Compass project or created the project using Foundation in the first place and just want to copy over any updated javascripts/image assets to your project, use the provided foundation/upgrade pattern below:

  1. cd /path/to/your-project
  2. run compass install -r zurb-foundation foundation/upgrade --force

Settings file updates: You can also upgrade Foundation as a whole, which will override the existing Foundation styles and your settings file. So if you've made changes to your settings file and want to make sure your project is on the latest version of Foundation, make sure you backup your settings file before you begin. Alternatively, you can copy/paste the settings from our file and @import your own so they don't get erased.

We also recommend creating a foundation-overrides.scss file that you can use for your own specific styles. This will ensure that your styles don't get obliterated upon updating. We do not recommend directly editing the Foundation files if you plan to upgrade. To update you project, use the following steps:

  1. Make sure you've updated your system version of the gem or upgrading won't work.
  2. cd /path/to/your-project
  3. run compass install -r zurb-foundation foundation

Creating a project from Git

Sometimes you want to checkout what we've got even before we decide to deploy a release candidate. For these situations, you can install using Bundler.

There are a few different ways to do this, but here's what we recommend:

  1. Setup a Foundation project folder: mkdir ~/awesomeapp
  2. Create a Gemfile with this content:
    source :rubygems
    gem "zurb-foundation", :git => "git@github.com:zurb/foundation.git"
    gem "compass"
  3. Then run: touch ~/awesomeapp/Gemfile
  4. Change into your application directory: cd ~/awesomeapp
  5. Create a project using Bundler: bundle exec compass create . -r zurb-foundation --using foundation
  6. When you're working on your project, run: bundle exec compass watch

Working with GUI applications

We want you to be able to work with Foundation in whatever way you are comfortable and we realize that not all of us are Terminal ninjas. Here's a rundown of some of the popular GUI applications and how to utilize Foundation with them.
CodeKit Project

We're using a version of Sass and Compass that doesn't come with CodeKit. This means that you'll need to do a couple steps in order to get everything to compile correctly:

  1. First things first, make sure you have the gem installed.
  2. Run [sudo] gem environment in the command line, note your gem executables path.
  3. Go into Codekit prefs, click on Sass/Scss
  4. Click on "Use the Sass executable at this path:"
  5. Navigate to the bin folder at the gem path you found earlier.
  6. Select sass.bin
  7. Click on Compass in the preferences menu.
  8. Click on "Use the Compass executable at this path:"
  9. Navigate to the bin folder at the gem path you found earlier.
  10. Select compass.bin
  11. Compile to your hearts content.

Note: CodeKit does not support adding Foundation as a "framework" through the GUI. You'll need to use the steps above to accomplish this.

LiveReload

While LiveReload works great within CodeKit, it doesn't work well on its own because you can't update it to use your system Sass and Compass directories. Do not use this application to compile Foundation.

Compass.app

Foundation is included with Compass.app.

Scout

This app doesn't have support for updating the version of Sass and Compass that you use so we're not supporting it at this point.


Learn to Customize with Scss

Since you've got the gem installed, it's time to learn how to use Scss to make your experience with Foundation even more fun and customizable. We've made it really easy to change parts of Foundation with some simple variables and added more power with mixins.
Scss Settings & Mixins »

Grab the copy of Foundation best for you, whether that's Scss or CSS, everything or just bits and pieces.

Install Foundation

Awesome product jobs:
via ZURBjobs