Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@codeforamerica/style

codeforamerica39MIT5.0.1

Code for America's Styleguide. http://v4.style.codeforamerica.org

code for america, style, style guide

readme

Code for America's Style Guide

======

  • Current stable version: 4 (release-2 tag / linkable url)
  • Previous release (unsupported): 3 (master branch / linkable url)

The style guide serves as the base CSS and organizing styles for www.codeforamerica.org. The style guide is primarily a living pattern library that explains how to use our CSS to build websites. It contains:

  • A Jekyll site that serves as a living style guide and pattern library
  • A foundational CSS structure built with Sass
  • A grid-based layout system using Bourbon and Neat
  • Basic web typography
  • Code for America specific page templates
  • Polyfills that help older versions of IE support HTML5 elements, pseudoclasses, media queries, and rem units.
  • Additional vendor JavaScript to help with interactions

History and past versions

Code for America's communications and tech teams originally worked with Brighton web design firm Clearleft and Colorado branding firm Dojo4 to create a new visual design and front-end for the Code for America website. This original pattern library existed through three major releases before being retired in favor of the current trimmed-down style guide in this repo that is solely focused on providing patterns for building www.codeforamerica.org. See the original pattern library repository.

How to use it to build websites

  1. Read the docs. Complete documentation of the pattern library with copy-and-pastable code snippets is available at https://v4.style.codeforamerica.org.
  2. Add links to your document. For example, add these links to your <head> tag:
<head>
  ...
  <!-- Pattern Library Stylesheets -->
  <link rel="stylesheet" type="text/css" href="https://v4.style.codeforamerica.org/css/main.css">
  <!-- Font Vendor Stylesheets -->
  <script src="https://use.typekit.net/lkd6vsz.js"></script>
  <script>try{Typekit.load({ async: true });}catch(e){}</script>
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  <!-- Shims For Old Browsers -->
  <!--[if lt IE 9]>
    <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <script src="https://s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
    <script src="/js/selectivizr-min-1.0.2.js"></script>
    <![endif]-->
  ...
</head>

And add the following after all the content in your <body> tag:

<body>
  ...other content...
  <!-- SCRIPTS -->
  <script src="https://v4.style.codeforamerica.org/js/jquery-1.11.2.min.js"></script>
  <script src="https://v4.style.codeforamerica.org/js/site.js"></script>
</body>

Develop locally

Prerequisites

Jekyll is a static site generator built with Ruby that needs the following to run:

Basic steps to get up and running

First, you need the prerequisites listed above. This starter requires Jekyll to be installed in order to build and preview. To install Jekyll, clone the repo, cd into the folder, and run bundle install:

$ git clone https://github.com/codeforamerica/style-guide.git
$ cd style-guide
$ bundle install

Running Locally

To preview the site locally, use the Jekyll command:

$ bundle exec jekyll serve

The site should be viewable at localhost:4000. The styleguide is located at 'localhost:4000/styleguide'.

Contributing

We welcome bugs, questions and suggestions in the form of issues, or features and code fixes in the form of a pull request.

Submitting a Pull Request

  1. Fork the project.
  2. Create a topic branch (name it something verb-y, like fix-layout-padding).
  3. Make your changes, and commit with descriptive commit messages.
  4. Push your changes.
  5. Submit a pull request.

Submitting an Issue

We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a screenshot and any additional details that can help us debug, such as your operating system and browser version.

License

Copyright (c) 2009-2015 Code for America. See the LICENSE for details.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[5.0.1] - 2019-02-27

Fixed

  • Remove duplicate slab color variant declarations

[5.0.0] - 2019-02-25

  • Too many changes to list. See the commit log for individual changes.

[4.0.9] - 2018-12-10

Added

  • Added .message--success for those times when things just... go well.

[4.0.8] - 2018-09-24

Changed

  • Darken .lead-in-text to improve contrast against white backgrounds

[4.0.7] - 2018-09-06

Added

  • Add three variables to customize "alert" molecule appearance.

[4.0.6] - 2018-09-06

Added

  • Add $global-header-logo-width and $global-header-logo-width-mobile variables

[4.0.5] - 2018-09-06

Added

  • Add margin-bottom to "message" component

[4.0.4] - 2018-08-28

Added

  • Add .card--white variant

Changed

  • Update "card" selectors to not require cards be anchor tags

[4.0.3] - 2018-08-28

Added

  • Add .message component
  • Add .message--caution and .message--danger component variants

[4.0.2] - 2018-08-14

Added

  • Add $mobile-nav-background-color variable to allow customization

[4.0.1] - 2018-08-13

Added

  • Add a quick new cmapaign-page template
  • Add hero-color variable
  • Add .info-alert component styling
  • Add dark blue slab style
  • Add $hero-color variable for customization

Changed

  • Improve <label> styling and display in style guide
  • Set background-size and background-position for hero elements
  • Change global alert background color on primary pages
  • Make all text in reverse-slabs white
  • Make all text in reverse-global-header white
  • Remove aggressive color styling from headings and home template
  • Make reverse-global-header alerts white with dark transparent background
  • Clean up empty CSS rule-sets