Files
webawesome/source/docs/installing.md
2017-08-18 23:11:13 -04:00

44 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
layout: default.html
title: Installing
description: How to install Shoelace.css.
---
## Installing
There are two ways to use Shoelace. If you want to get things up and running quickly, use the `dist/` version or the [CDN version](#cdn). This version isnt customizable, nor can you use future CSS features with it. Its primarily intended for prototyping.
If youre developing a production app, you should [build Shoelace from source](#building-from-source). This version is completely customizable, modular, and lets you use future CSS features _today_.
**Note:** To make certain components interactive (e.g. dropdowns and tabs), youll need to load [jQuery](https://cdnjs.com/libraries/jquery/) or [Zepto](https://cdnjs.com/libraries/zepto/) before `shoelace.js`.
### CDN
This is the best approach for prototyping, however, this version isnt customizable and doesnt support future CSS features. To load Shoelace via CDN, add this to your `<head>`:
```html
<link rel="stylesheet" href="https://cdn.shoelace.style/{{version}}/shoelace.css">
```
And this before `</body>` but after jQuery/Zepto:
```html
<script src="https://cdn.shoelace.style/{{version}}/shoelace.js"></script>
```
This service is provided free, courtesy of [KeyCDN](https://keycdn.com/).
### Building From Source
To make the most out of Shoelace, you should build it from source. This will let you use future CSS features _today_, such as [CSS variables](https://www.w3.org/TR/css-variables/), [nesting](http://tabatkins.github.io/specs/css-nesting/), [color functions](https://drafts.csswg.org/css-color/#modifying-colors), [and more](http://cssnext.io/features/). It also gives you complete control over customizing Shoelace.
The recommended way to build Shoelace is with [cssnext](http://cssnext.io/). There are instructions for webpack, gulp, grunt, browserify, and others located on the [setup page](http://cssnext.io/setup/).
You can [download Shoelace](https://github.com/claviska/shoelace-css/releases) from GitHub, but its probably better to use the npm version:
```text
npm install shoelace-css
```
The main source file is `source/css/shoelace.css`. This sets core variables and imports all of Shoelaces components. If you dont need everything, youre encouraged to create your own and import only the ones youre going to use.