2.11.0 • Published 7 years ago

cloudgov-style v2.11.0

Weekly downloads
154
License
SEE LICENSE in LI...
Repository
github
Last release
7 years ago

cg-style

This repository houses cg-style or cloudgov-style, a shared style library for the cloud.gov product ecosystem. Cloudgov-style was built on top of the US Web Design Standards.

The purpose of cg-style is to provide the assets such as CSS, SCSS, JS, images and fonts to design a site with the visual style of cloud.gov. This allows multiple sites built in separate repositories and with different languages to share a global style without repeating styling code. The cg-style library is primarily distributed on the node/npm ecosystem.

Install and use

node/npm

The best way to install cg-style is with the node package manager or npm. If you haven't already cloned the cg-style repository for development use(#development, run the following command on a computer with node/npm installed to install cg-style into your project

npm install cloudgov-style --save

Once installed, all the assets from cg-style have to be consumed by your project. This can be done in multiple ways depending on what assets and your project setup. For example, a simple site could copy over the relevant assets with build commands and include them from the html with link tags.

# build commands
cp ./node_modules/cloudgov-style/js/* ./public/js
cp ./node_modules/cloudgov-style/css/* ./public/css
cp -R ./node_modules/cloudgov-style/img/**/* ./public/img
cp -R ./node_modules/cloudgov-style/fonts/**/* ./public/fonts
<!- html file ->
<head>
...
<link href="/public/css/cloudgov-style.css" rel="stylesheet" />
</head>

<body>
  <svg class="logo">
    <use xlink:href="/public/img/cloudgov-sprite.svg#logo"/>
  </svg>

  <script src="/public/js/cloudgov-style.js"></script>
</body>

Another possibility for importing the JS and SCSS is to use browserify and SASS to import them into the project.

require('cloudgov-style');
@import './node_modules/cloudgov-style/src/css/main.scss';

Using svg images

Images that are part of the cg-style project are available as one central svg sprite with each image consisting of a svg <symbol>. To use these images, you can use the svg xlink attribute as follows:

  <svg class="icon">
    <use xlink:href="/public/img/cloudgov-sprite.svg#i-agreement"/>
  </svg>

Development and contributing setup

See the CONTRIBUTING documentation.

2.11.0

7 years ago

2.10.0

7 years ago

2.9.1

8 years ago

2.9.0

8 years ago

2.8.0

8 years ago

2.7.0

8 years ago

2.6.5

8 years ago

2.6.4

8 years ago

2.6.3

8 years ago

2.6.2

9 years ago

2.6.1

9 years ago

2.6.0

9 years ago

2.5.5

9 years ago

2.5.4

9 years ago

2.5.3

9 years ago

2.5.2

9 years ago

2.5.1

9 years ago

2.5.0

9 years ago

2.4.1

9 years ago

2.4.0

9 years ago

2.3.1

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.3

9 years ago

2.1.2

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.7.3

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.1

9 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago