Before installing and using uswds-rails, you'll want to have Ruby 2.2.9 (or newer) installed on your computer. There are plenty of ways to go about this, but my preference is rbenv. If you're developing on a Mac and using Homebrew, installing rbenv is super easy.
uswds-rails might work with other versions of Ruby, but it's developed in 2.5.1 and automatically tested against 2.2.9, 2.3.7, 2.4.4, and 2.5.1 by Travis CI.
Add uswds-rails to your Ruby on Rails project's Gemfile:
ruby '2.5.1' source 'https://rubygems.org' source 'https://rails-assets.org' gem 'rails', '~> 5.1' gem 'uswds-rails', '~> 1.4'
bundle install to install uswds-rails and its dependencies.
The most basic integration looks like:
// In `app/assets/stylesheets/application.scss` @import "uswds/uswds";
Adding those lines to your project's
Don't want to include the entire stylesheet in your project? Not to worry! You may include individual SCSS files by using uswds-rails'
app/assets/stylesheets/uswds/uswds.scss as a guide.
For details on setting up your development environment and contributing to this project, see CONTRIBUTING.md.
uswds-rails is written and maintained by Jason Garber.