uswds-rails 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.codeclimate.yml +17 -0
- data/.editorconfig +14 -0
- data/.gitignore +28 -0
- data/.rspec +3 -0
- data/.rubocop +3 -0
- data/.rubocop.yml +16 -0
- data/.ruby-version +1 -0
- data/.simplecov +13 -0
- data/.travis.yml +18 -0
- data/CONTRIBUTING.md +50 -0
- data/Gemfile +4 -0
- data/LICENSE.md +27 -0
- data/README.md +64 -0
- data/Rakefile +8 -0
- data/app/assets/stylesheets/uswds/components/_accordions.scss +150 -0
- data/app/assets/stylesheets/uswds/components/_alerts.scss +85 -0
- data/app/assets/stylesheets/uswds/components/_footer.scss +382 -0
- data/app/assets/stylesheets/uswds/components/_forms.scss +164 -0
- data/app/assets/stylesheets/uswds/components/_hero.scss +43 -0
- data/app/assets/stylesheets/uswds/components/_navigation.scss +446 -0
- data/app/assets/stylesheets/uswds/components/_search.scss +106 -0
- data/app/assets/stylesheets/uswds/core/_utilities.scss +232 -0
- data/app/assets/stylesheets/uswds/core/_variables.scss +112 -0
- data/app/assets/stylesheets/uswds/elements/_inputs.scss +346 -0
- data/app/assets/stylesheets/uswds/elements/_typography.scss +257 -0
- data/app/assets/stylesheets/uswds/uswds.scss +44 -0
- data/lib/uswds-rails.rb +1 -0
- data/lib/uswds/rails.rb +7 -0
- data/lib/uswds/rails/engine.rb +17 -0
- data/lib/uswds/rails/version.rb +6 -0
- data/uswds-rails.gemspec +36 -0
- data/vendor/assets/fonts/uswds/merriweather-bold-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/merriweather-bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/merriweather-bold-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/merriweather-bold-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/merriweather-italic-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/merriweather-italic-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/merriweather-italic-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/merriweather-italic-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/merriweather-light-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/merriweather-light-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/merriweather-light-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/merriweather-light-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/merriweather-regular-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/merriweather-regular-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/merriweather-regular-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/merriweather-regular-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.woff2 +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.eot +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.ttf +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.woff +0 -0
- data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.woff2 +0 -0
- data/vendor/assets/images/uswds/alerts/error.png +0 -0
- data/vendor/assets/images/uswds/alerts/error.svg +17 -0
- data/vendor/assets/images/uswds/alerts/info.png +0 -0
- data/vendor/assets/images/uswds/alerts/info.svg +18 -0
- data/vendor/assets/images/uswds/alerts/success.png +0 -0
- data/vendor/assets/images/uswds/alerts/success.svg +12 -0
- data/vendor/assets/images/uswds/alerts/warning.png +0 -0
- data/vendor/assets/images/uswds/alerts/warning.svg +16 -0
- data/vendor/assets/images/uswds/angle-arrow-down-hover.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-down-hover.svg +1 -0
- data/vendor/assets/images/uswds/angle-arrow-down-primary-hover.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-down-primary-hover.svg +1 -0
- data/vendor/assets/images/uswds/angle-arrow-down-primary.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-down-primary.svg +1 -0
- data/vendor/assets/images/uswds/angle-arrow-down.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-down.svg +1 -0
- data/vendor/assets/images/uswds/angle-arrow-up-primary-hover.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-up-primary-hover.svg +1 -0
- data/vendor/assets/images/uswds/angle-arrow-up-primary.png +0 -0
- data/vendor/assets/images/uswds/angle-arrow-up-primary.svg +1 -0
- data/vendor/assets/images/uswds/arrow-down.png +0 -0
- data/vendor/assets/images/uswds/arrow-down.svg +1 -0
- data/vendor/assets/images/uswds/arrow-right.png +0 -0
- data/vendor/assets/images/uswds/arrow-right.svg +1 -0
- data/vendor/assets/images/uswds/circle-124.png +0 -0
- data/vendor/assets/images/uswds/close.png +0 -0
- data/vendor/assets/images/uswds/close.svg +1 -0
- data/vendor/assets/images/uswds/correct8.png +0 -0
- data/vendor/assets/images/uswds/correct8.svg +1 -0
- data/vendor/assets/images/uswds/correct9.png +0 -0
- data/vendor/assets/images/uswds/correct9.svg +1 -0
- data/vendor/assets/images/uswds/external-link-alt-hover.png +0 -0
- data/vendor/assets/images/uswds/external-link-alt-hover.svg +1 -0
- data/vendor/assets/images/uswds/external-link-alt.png +0 -0
- data/vendor/assets/images/uswds/external-link-alt.svg +1 -0
- data/vendor/assets/images/uswds/external-link-hover.png +0 -0
- data/vendor/assets/images/uswds/external-link-hover.svg +1 -0
- data/vendor/assets/images/uswds/external-link.png +0 -0
- data/vendor/assets/images/uswds/external-link.svg +1 -0
- data/vendor/assets/images/uswds/favicons/favicon-114.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-144.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-16.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-192.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-40.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-57.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon-72.png +0 -0
- data/vendor/assets/images/uswds/favicons/favicon.ico +0 -0
- data/vendor/assets/images/uswds/favicons/favicon.png +0 -0
- data/vendor/assets/images/uswds/hero.png +0 -0
- data/vendor/assets/images/uswds/icon-dot-gov.svg +1 -0
- data/vendor/assets/images/uswds/icon-https.svg +1 -0
- data/vendor/assets/images/uswds/logo-img.png +0 -0
- data/vendor/assets/images/uswds/minus-alt.png +0 -0
- data/vendor/assets/images/uswds/minus-alt.svg +1 -0
- data/vendor/assets/images/uswds/minus.png +0 -0
- data/vendor/assets/images/uswds/minus.svg +1 -0
- data/vendor/assets/images/uswds/plus-alt.png +0 -0
- data/vendor/assets/images/uswds/plus-alt.svg +1 -0
- data/vendor/assets/images/uswds/plus.png +0 -0
- data/vendor/assets/images/uswds/plus.svg +1 -0
- data/vendor/assets/images/uswds/search-alt.png +0 -0
- data/vendor/assets/images/uswds/search-alt.svg +1 -0
- data/vendor/assets/images/uswds/search.png +0 -0
- data/vendor/assets/images/uswds/search.svg +1 -0
- data/vendor/assets/images/uswds/social-icons/png/facebook25.png +0 -0
- data/vendor/assets/images/uswds/social-icons/png/rss25.png +0 -0
- data/vendor/assets/images/uswds/social-icons/png/twitter16.png +0 -0
- data/vendor/assets/images/uswds/social-icons/png/youtube15.png +0 -0
- data/vendor/assets/images/uswds/social-icons/svg/facebook25.svg +1 -0
- data/vendor/assets/images/uswds/social-icons/svg/rss25.svg +1 -0
- data/vendor/assets/images/uswds/social-icons/svg/twitter16.svg +1 -0
- data/vendor/assets/images/uswds/social-icons/svg/youtube15.svg +1 -0
- data/vendor/assets/images/uswds/us_flag_small.png +0 -0
- data/vendor/assets/javascripts/uswds/uswds.js +1739 -0
- data/vendor/assets/stylesheets/uswds/components/_accordions.scss +150 -0
- data/vendor/assets/stylesheets/uswds/components/_alerts.scss +85 -0
- data/vendor/assets/stylesheets/uswds/components/_banner.scss +204 -0
- data/vendor/assets/stylesheets/uswds/components/_footer.scss +382 -0
- data/vendor/assets/stylesheets/uswds/components/_forms.scss +164 -0
- data/vendor/assets/stylesheets/uswds/components/_graphic-list.scss +35 -0
- data/vendor/assets/stylesheets/uswds/components/_header.scss +221 -0
- data/vendor/assets/stylesheets/uswds/components/_hero.scss +43 -0
- data/vendor/assets/stylesheets/uswds/components/_layout.scss +36 -0
- data/vendor/assets/stylesheets/uswds/components/_media-block.scss +12 -0
- data/vendor/assets/stylesheets/uswds/components/_navigation.scss +446 -0
- data/vendor/assets/stylesheets/uswds/components/_search.scss +106 -0
- data/vendor/assets/stylesheets/uswds/components/_section.scss +37 -0
- data/vendor/assets/stylesheets/uswds/components/_sidenav.scss +8 -0
- data/vendor/assets/stylesheets/uswds/components/_skipnav.scss +19 -0
- data/vendor/assets/stylesheets/uswds/core/_base.scss +30 -0
- data/vendor/assets/stylesheets/uswds/core/_fonts.scss +65 -0
- data/vendor/assets/stylesheets/uswds/core/_grid.scss +154 -0
- data/vendor/assets/stylesheets/uswds/core/_utilities.scss +232 -0
- data/vendor/assets/stylesheets/uswds/core/_variables.scss +123 -0
- data/vendor/assets/stylesheets/uswds/elements/_buttons.scss +191 -0
- data/vendor/assets/stylesheets/uswds/elements/_embed.scss +26 -0
- data/vendor/assets/stylesheets/uswds/elements/_figure.scss +13 -0
- data/vendor/assets/stylesheets/uswds/elements/_inputs.scss +346 -0
- data/vendor/assets/stylesheets/uswds/elements/_labels.scss +20 -0
- data/vendor/assets/stylesheets/uswds/elements/_list.scss +32 -0
- data/vendor/assets/stylesheets/uswds/elements/_table.scss +47 -0
- data/vendor/assets/stylesheets/uswds/elements/_typography.scss +257 -0
- data/vendor/assets/stylesheets/uswds/uswds.scss +41 -0
- metadata +394 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e314ae13b7f9d59527fe05e405a066e0ba0366fd
|
|
4
|
+
data.tar.gz: ba6bbb25fa3cba7206c81a9e9b643d9075c437d4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 473fe9d83db1bb136ef628f282e2a83dbc78e07b32f8779ab000bb871397ff09a1534638c2696a2188c6a85ef43651b63e7d94435734e2a298f4621c60eedce0
|
|
7
|
+
data.tar.gz: 5b1d4da9606823003a3c98328ad8f3eb51885f7ed3293ede368f47c4529206b0b553f71ba0b7398d277eff79eb799809377279b1df5b5ecfa065549b1695cd98
|
data/.codeclimate.yml
ADDED
data/.editorconfig
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# EditorConfig is awesome: http://EditorConfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
insert_final_newline = true
|
|
8
|
+
indent_size = 2
|
|
9
|
+
indent_style = space
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
|
|
12
|
+
[*.md]
|
|
13
|
+
indent_size = 4
|
|
14
|
+
indent_style = tab
|
data/.gitignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
/.config
|
|
4
|
+
/coverage/
|
|
5
|
+
/InstalledFiles
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/spec/examples.txt
|
|
9
|
+
/test/tmp/
|
|
10
|
+
/test/version_tmp/
|
|
11
|
+
/tmp/
|
|
12
|
+
|
|
13
|
+
# Documentation cache and generated files:
|
|
14
|
+
/.yardoc/
|
|
15
|
+
/_yardoc/
|
|
16
|
+
/doc/
|
|
17
|
+
/rdoc/
|
|
18
|
+
|
|
19
|
+
# Environment normalization:
|
|
20
|
+
/.bundle/
|
|
21
|
+
/vendor/bundle
|
|
22
|
+
/lib/bundler/man/
|
|
23
|
+
|
|
24
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
25
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
26
|
+
Gemfile.lock
|
|
27
|
+
# .ruby-version
|
|
28
|
+
# .ruby-gemset
|
data/.rspec
ADDED
data/.rubocop
ADDED
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.4.1
|
data/.simplecov
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'simplecov-console'
|
|
2
|
+
|
|
3
|
+
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
|
4
|
+
|
|
5
|
+
if RSpec.configuration.files_to_run.length > 1
|
|
6
|
+
formatters << SimpleCov::Formatter::Console
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
SimpleCov.start do
|
|
10
|
+
add_filter 'spec/dummy'
|
|
11
|
+
|
|
12
|
+
formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
|
|
13
|
+
end
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
cache: bundler
|
|
3
|
+
rvm:
|
|
4
|
+
- 2.2.7
|
|
5
|
+
- 2.3.4
|
|
6
|
+
- 2.4.1
|
|
7
|
+
before_install:
|
|
8
|
+
- gem update --system
|
|
9
|
+
- gem update bundler
|
|
10
|
+
before_script:
|
|
11
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
12
|
+
- chmod +x ./cc-test-reporter
|
|
13
|
+
- ./cc-test-reporter before-build
|
|
14
|
+
after_success:
|
|
15
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
|
16
|
+
notifications:
|
|
17
|
+
email: false
|
|
18
|
+
slack: sixtwothree:yATLmjTW15443qR7jbCWr3RO
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Contributing to uswds-rails
|
|
2
|
+
|
|
3
|
+
Anyone is welcome to contribute code changes and additions to this project. If you'd like your changes merged into the master branch, please read the following document before opening a [pull request][pulls].
|
|
4
|
+
|
|
5
|
+
There are several ways in which you can help improve this project:
|
|
6
|
+
|
|
7
|
+
1. Fix an existing [issue][issues] and submit a [pull request][pulls].
|
|
8
|
+
1. Review open [pull requests][pulls].
|
|
9
|
+
1. Report a new [issue][issues]. _Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue._
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Getting Started](#getting-started)
|
|
14
|
+
- [Making Changes](#making-changes)
|
|
15
|
+
- [Code Style](#code-style)
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
uswds-rails is written in [Ruby](https://www.ruby-lang.org/en/) (version 2.4.1) and development dependencies are managed using the [Bundler](http://bundler.io/) gem. [Travis CI builds](https://travis-ci.org/jgarber623/uswds-rails) use Ruby 2.2.7, 2.3.4, and 2.4.1.
|
|
20
|
+
|
|
21
|
+
I manage Ruby versions with [rbenv](https://github.com/rbenv/rbenv). I'd recommend you do the same or use a similar Ruby version manager ([chruby](https://github.com/postmodern/chruby/) or [RVM](https://rvm.io/) come to mind). Once you've installed Ruby 2.4.1 using your method of choice, install the project's gems by running:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
bundle install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
…from the root of the project.
|
|
28
|
+
|
|
29
|
+
## Making Changes
|
|
30
|
+
|
|
31
|
+
1. Fork and clone the project's repo.
|
|
32
|
+
1. Install development dependencies as outlined above.
|
|
33
|
+
1. Create a feature branch for the code changes you're looking to make: `git checkout -b your-descriptive-branch-name origin/master`.
|
|
34
|
+
1. _Write some code!_
|
|
35
|
+
1. Build (`bundle exec rake build`) and install (`bundle exec rake install`) your updated code.
|
|
36
|
+
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bin/rake spec`.
|
|
37
|
+
1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://chris.beams.io/posts/git-commit/) for tips on writing useful Git commit messages.)_
|
|
38
|
+
1. Push the branch to your fork: `git push -u origin your-descriptive-branch-name`.
|
|
39
|
+
1. Create a new pull request and we'll review your changes.
|
|
40
|
+
|
|
41
|
+
## Code Style
|
|
42
|
+
|
|
43
|
+
Code formatting conventions are defined in the `.editorconfig` file which uses the [EditorConfig](http://editorconfig.org/) syntax. There are [plugins for a variety of editors](http://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file. It is recommended that you install the EditorConfig plugin for your editor of choice.
|
|
44
|
+
|
|
45
|
+
Your bug fix or feature addition won't be rejected if it runs afoul of any (or all) of these guidelines, but following the guidelines will definitely make everyone's lives a little easier.
|
|
46
|
+
|
|
47
|
+
[gemfile]: https://github.com/jgarber623/uswds-rails/blob/master/Gemfile
|
|
48
|
+
[issues]: https://github.com/jgarber623/uswds-rails/issues
|
|
49
|
+
[license]: https://github.com/jgarber623/uswds-rails/blob/master/LICENSE.md
|
|
50
|
+
[pulls]: https://github.com/jgarber623/uswds-rails/pulls
|
data/Gemfile
ADDED
data/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# License Information
|
|
2
|
+
|
|
3
|
+
uswds-rails includes portions of the [U.S. Web Design Standards](https://github.com/18F/web-design-standards) released under a [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/). Portions of the U.S. Web Design Standards are not in the public domain. Additional licensing information can be found in the project's [LICENSE.md](https://github.com/18F/web-design-standards/blob/develop/LICENSE.md).
|
|
4
|
+
|
|
5
|
+
The remainder of uswds-rails is licensed under the [MIT License](https://opensource.org/licenses/MIT), the full text of which is included below.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Copyright 2017 Jason Garber
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
```
|
data/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# uswds-rails
|
|
2
|
+
|
|
3
|
+
A Ruby gem for integrating the [U.S. Web Design Standards](https://github.com/18F/web-design-standards) into a [Ruby on Rails](http://rubyonrails.org) application.
|
|
4
|
+
|
|
5
|
+
[](https://rubygems.org/gems/uswds-rails)
|
|
6
|
+
[](https://rubygems.org/gems/uswds-rails)
|
|
7
|
+
[](https://travis-ci.org/jgarber623/uswds-rails)
|
|
8
|
+
[](https://codeclimate.com/github/jgarber623/uswds-rails)
|
|
9
|
+
[](https://codeclimate.com/github/jgarber623/uswds-rails/coverage)
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
12
|
+
|
|
13
|
+
Before installing and using uswds-rails, you'll want to have Ruby 2.2.7 (or newer) installed on your computer. There are plenty of ways to go about this, but my preference is [rbenv](https://github.com/sstephenson/rbenv). If you're developing on a Mac and using [Homebrew](http://brew.sh/), installing rbenv is [super easy](https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x).
|
|
14
|
+
|
|
15
|
+
uswds-rails _might_ work with other versions of Ruby, but it's developed in 2.4.1 and automatically tested against 2.2.7 and 2.3.4 by [Travis CI](https://travis-ci.org/jgarber623/uswds-rails).
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Add uswds-rails to your Ruby on Rails project's Gemfile:
|
|
20
|
+
|
|
21
|
+
```rb
|
|
22
|
+
ruby '2.4.1'
|
|
23
|
+
|
|
24
|
+
source 'https://rubygems.org' do
|
|
25
|
+
gem 'rails', '~> 5.1'
|
|
26
|
+
gem 'uswds-rails'
|
|
27
|
+
end
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Run `bundle install` to install uswds-rails and its dependencies.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
uswds-rails makes available to your Rails application the fonts, images, JavaScript files, and stylesheets from the U.S. Web Design Standards. Including the files varies depending on type.
|
|
35
|
+
|
|
36
|
+
The most basic integration looks like:
|
|
37
|
+
|
|
38
|
+
```scss
|
|
39
|
+
// In `app/assets/stylesheets/application.scss`
|
|
40
|
+
@import "uswds/uswds";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
// In `app/assets/javascripts/application.js`
|
|
45
|
+
//= require "uswds/uswds";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Adding those lines to your project's `application.scss` and `application.js` will include _everything_ from the U.S. Web Design Standards (fonts, JavaScript, and stylesheets).
|
|
49
|
+
|
|
50
|
+
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`](https://github.com/jgarber623/uswds-rails/blob/master/app/assets/stylesheets/uswds/uswds.scss) as a guide.
|
|
51
|
+
|
|
52
|
+
## Contributing
|
|
53
|
+
|
|
54
|
+
For details on setting up your development environment and contributing to this project, see [CONTRIBUTING.md](https://github.com/jgarber623/uswds-rails/blob/master/CONTRIBUTING.md).
|
|
55
|
+
|
|
56
|
+
## Acknowledgments
|
|
57
|
+
|
|
58
|
+
This project woudn't exist without the [18F](https://github.com/18F) team's hard work on the [U.S. Web Design Standards](https://github.com/18F/web-design-standards).
|
|
59
|
+
|
|
60
|
+
uswds-rails is written and maintained by [Jason Garber](https://github.com/jgarber623).
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
uswds-rails is freely available under the [MIT License](https://opensource.org/licenses/MIT). Portions of the project contain code released under different licenses. See [LICENSE.md](https://github.com/jgarber623/uswds-rails/blob/master/LICENSE.md) for additional licensing information.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Variables
|
|
2
|
+
|
|
3
|
+
$accordion-border: 3px solid $color-gray-lightest;
|
|
4
|
+
|
|
5
|
+
// Accordion Styles
|
|
6
|
+
|
|
7
|
+
@mixin accordion-list-styles {
|
|
8
|
+
@include unstyled-list;
|
|
9
|
+
color: $color-base;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin accordion-list-item-styles {
|
|
16
|
+
background-color: $color-gray-lightest;
|
|
17
|
+
font-family: $font-sans;
|
|
18
|
+
list-style: none;
|
|
19
|
+
margin-bottom: 6px;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// scss-lint:disable PropertyCount
|
|
24
|
+
@mixin accordion-button-styles {
|
|
25
|
+
@include button-unstyled;
|
|
26
|
+
background-color: $color-gray-lightest;
|
|
27
|
+
background-image: asset-url('#{$image-path}/minus.png');
|
|
28
|
+
background-image: asset-url('#{$image-path}/minus.svg');
|
|
29
|
+
background-position: right 3rem center;
|
|
30
|
+
background-repeat: no-repeat;
|
|
31
|
+
background-size: 13px;
|
|
32
|
+
color: $color-base;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
font-family: $font-sans;
|
|
36
|
+
font-weight: $font-bold;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 1.5rem 5.5rem 1.5rem 3rem;
|
|
39
|
+
width: 100%;
|
|
40
|
+
|
|
41
|
+
&:focus {
|
|
42
|
+
box-shadow: $focus-shadow;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: $color-gray-lighter;
|
|
47
|
+
color: $color-base;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h1,
|
|
51
|
+
h2,
|
|
52
|
+
h3,
|
|
53
|
+
h4,
|
|
54
|
+
h5,
|
|
55
|
+
h6 {
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// scss-lint:enable PropertyCount
|
|
60
|
+
|
|
61
|
+
@mixin accordion-button-unopened-styles {
|
|
62
|
+
background-image: asset-url('#{$image-path}/plus.png');
|
|
63
|
+
background-image: asset-url('#{$image-path}/plus.svg');
|
|
64
|
+
background-repeat: no-repeat;
|
|
65
|
+
background-size: 1.3rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin accordion-nested-list {
|
|
69
|
+
> ul li ul {
|
|
70
|
+
list-style: disc;
|
|
71
|
+
> li > ul {
|
|
72
|
+
list-style: circle;
|
|
73
|
+
> li > ul {
|
|
74
|
+
list-style: square;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.usa-accordion,
|
|
81
|
+
.usa-accordion-bordered {
|
|
82
|
+
@include accordion-list-styles;
|
|
83
|
+
@include accordion-nested-list;
|
|
84
|
+
|
|
85
|
+
+ .usa-accordion,
|
|
86
|
+
+ .usa-accordion-bordered {
|
|
87
|
+
margin-top: 1rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// TODO deprecated ruleset based on old accordion.
|
|
91
|
+
> ul {
|
|
92
|
+
@include accordion-list-styles;
|
|
93
|
+
|
|
94
|
+
// TODO deprecated ruleset based on old accordion.
|
|
95
|
+
> li {
|
|
96
|
+
@include accordion-list-item-styles;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// TODO deprecated ruleset based on old accordion.
|
|
100
|
+
button {
|
|
101
|
+
@include accordion-button-styles;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// TODO deprecated ruleset based on old accordion.
|
|
105
|
+
[aria-expanded=false] {
|
|
106
|
+
@include accordion-button-unopened-styles;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> li {
|
|
111
|
+
@include accordion-list-item-styles;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.usa-accordion-bordered {
|
|
117
|
+
.usa-accordion-content {
|
|
118
|
+
border-bottom: $accordion-border;
|
|
119
|
+
border-left: $accordion-border;
|
|
120
|
+
border-right: $accordion-border;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.usa-accordion-content {
|
|
125
|
+
background-color: $color-white;
|
|
126
|
+
overflow: auto;
|
|
127
|
+
padding: 3rem;
|
|
128
|
+
|
|
129
|
+
> *:first-child {
|
|
130
|
+
margin-top: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
> *:last-child {
|
|
134
|
+
margin-bottom: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&:not([aria-hidden]) {
|
|
138
|
+
@include sr-only();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@include accessibly-hidden();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.usa-accordion-button {
|
|
145
|
+
@include accordion-button-styles;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.usa-accordion-button[aria-expanded=false] {
|
|
149
|
+
@include accordion-button-unopened-styles;
|
|
150
|
+
}
|