Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 10cf2fe

Browse files
committed
Update README with getting started and an example
License: MIT Signed-off-by: Oli Evans <[email protected]>
1 parent dc110ea commit 10cf2fe

File tree

3 files changed

+1562
-1512
lines changed

3 files changed

+1562
-1512
lines changed

README.md

+83-33
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,73 @@
1-
# Deprecated until further notice.
1+
# IPFS UI Style Guide
22

3-
### Please Refer to
3+
A shared style guide for UI design in the IPFS universe.
44

5-
- https://github.com/ipfs-shipyard/ipfs-css
6-
- https://github.com/ipfs-shipyard/pm-ipfs-gui/issues/7#issuecomment-364497449
5+
Reuse these [colors](#colors), [typography](#typography), and [spacing](#spacing) values to create a coherent feel across all IPFS applications.
76

8-
for the official colors, icons and typeography of the IPFS universe.
7+
## Getting started
98

10-
This repo will be rebooted with the latest UI style guide as part of the IPFS User Interface project
11-
https://github.com/ipfs-shipyard/pm-ipfs-gui
9+
These examples use [tachyons] and [ipfs-css]. Using the [Parcel] bundler you can create a index.css file and simply import them.
1210

13-
# ~~IPFS UI Style Guide~~
11+
```css
12+
@import tachyons;
13+
@import ipfs-css;
14+
```
1415

15-
A shared style guide for UI design in the IPFS universe.
16+
If you're using webpack or [create-react-app] you can install them from npm and import them from `node_modules`. Assuming your index.css lives in `/src` you would import them like:
17+
18+
```css
19+
@import "../node_modules/tachyons";
20+
@import "../node_modules/ipfs-css";
21+
```
22+
23+
`ipfs-css` comes bundled [InterUI] and [Montserrat] woff2 files when installed from npm. If you are using [Parcel] or [create-react-app] then the font files will be copied into your project automatically.
24+
25+
Otherwise you will need to copy them from your `node_modules` and ensure the paths in the `@font-face` definitions are correct. It may be simpler to copy the [`@font-face` definitions](https://github.com/ipfs-shipyard/ipfs-css/blob/master/ipfs.css#L8-L104) from [ipfs-css] override them in your `index.css` file to point to where you have copied the fonts to.
26+
27+
## Examples
28+
29+
#### Header
30+
31+
```html
32+
<header class="flex items-center pa3 bg-navy">
33+
<a href="https://ipfs.io" title="home" class="w-50">
34+
<img src="https://ipfs.io/images/ipfs-logo.svg" style="height: 50px" />
35+
</a>
36+
<h1 class="w-50 ma0 tr f3 fw2 montserrat aqua">CID inspector</h1>
37+
</header>
38+
```
39+
40+
![header example](img/header-cid-inspector.png)
41+
42+
Where
43+
44+
```html
45+
<header class="flex items-center pa3 bg-navy">
46+
```
47+
48+
Gives us a container with [flexbox](http://tachyons.io/docs/layout/flexbox/) powers, vertically centered children via `items-center` and a dark blue, `bg-navy` background.
49+
50+
51+
```html
52+
<h1 class="w-50 ma0 tr f3 fw2 montserrat aqua">CID inspector</h1>
53+
```
54+
55+
Gives us the `aqua` blue text in fancy `montserrat` font. The font-weight is `fw2` (_200 - Extra Light_) and font size `f3` on our [type scale](#typography), which is `24px` olde raster units.
56+
57+
It's given a 50% width with `w-50` and the text aligns to the right with `tr`. It's given a semanticaly pleaseing `h1` tag, but we don't want the usual jumbo bottom margin that headers get, so we zero out the margins with `ma0` which reads "margin, all sides, zero".
1658

17-
Reuse these [colors](#colors), [typography](#typography), and [spacing](#spacing) values to create a coherent feel across all IPFS applications.
1859

1960
## Colors
2061

21-
_Extracted from [ipfs.io] and **TBC**_
62+
<img title='#0b3a53' src='https://swatches.now.sh?color=%230b3a53&name=navy' /><img title='#244e66' src='https://swatches.now.sh?color=%23244e66&name=navy-muted' /><img title='#69c4cd' src='https://swatches.now.sh?color=%2369c4cd&name=aqua' /><img title='#9ad4db' src='https://swatches.now.sh?color=%239ad4db&name=aqua-muted' />
2263

23-
| teal | turquoise | blue |
24-
|------------|-----------|-----------|
25-
| `#469ea2` | `#6acad1` | `#00b0e9` |
26-
| <img title='teal' src='http://swatches.now.sh/?color=%23469ea2'/> | <img title='turquoise' src='http://swatches.now.sh/?color=%236acad1'/> | <img title='blue' src='http://swatches.now.sh/?color=%2300b0e9'/>
64+
<img title='#b7bbc8' src='https://swatches.now.sh?color=%23b7bbc8&name=gray' /><img title='#d9dbe2' src='https://swatches.now.sh?color=%23d9dbe2&name=gray-muted' /><img title='#34373f' src='https://swatches.now.sh?color=%2334373f&name=charcoal' /><img title='#7f8491' src='https://swatches.now.sh?color=%237f8491&name=charcoal-muted' />
2765

28-
| red | orange | beige |
29-
|------------|-----------|-----------|
30-
| `#f05234` | `#f59223` | `#ffe5ca` |
31-
| <img title='red' src='http://swatches.now.sh/?color=%23f05234'/> | <img title='orange' src='http://swatches.now.sh/?color=%23f59223'/> | <img title='beige' src='http://swatches.now.sh/?color=%23ffe5ca'/>
66+
<img title='#ea5037' src='https://swatches.now.sh?color=%23ea5037&name=red' /><img title='#f36149' src='https://swatches.now.sh?color=%23f36149&name=red-muted' /><img title='#f39021' src='https://swatches.now.sh?color=%23f39021&name=yellow' /><img title='#f9a13e' src='https://swatches.now.sh?color=%23f9a13e&name=yellow-muted' />
3267

68+
<img title='#3e9096' src='https://swatches.now.sh?color=%233e9096&name=teal' /><img title='#439a9d' src='https://swatches.now.sh?color=%23439a9d&name=teal-muted' /><img title='#0cb892' src='https://swatches.now.sh?color=%230cb892&name=green' /><img title='#0aca9f' src='https://swatches.now.sh?color=%230aca9f&name=green-muted' />
3369

34-
| blue black | text gray | light gray |
35-
|------------|------------|------------|
36-
| `#041727` | `#4d5659` | `#b7c0c3` |
37-
| <img title='blue black' src='http://swatches.now.sh/?color=%23041727'/> | <img title='text gray' src='http://swatches.now.sh/?color=%234d5659'/> | <img title='light gray' src='http://swatches.now.sh/?color=%23b7c0c3'/>
70+
<img title='#edf0f4' src='https://swatches.now.sh?color=%23edf0f4&name=snow' /><img title='#f7f8fa' src='https://swatches.now.sh?color=%23f7f8fa&name=snow-muted' />
3871

3972
### Fancy hero header gradient
4073

@@ -56,20 +89,26 @@ Rendered example
5689

5790
## Typography
5891

59-
_Extracted from [tachyons] and **TBC**_
92+
For general instructional text we use [InterUI] as our default sans-serif font.
93+
94+
```css
95+
.sans-serif {
96+
font-family: 'Inter UI', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
97+
}
98+
```
6099

61-
### Font family
100+
See:
101+
- https://css-tricks.com/snippets/css/system-font-stack/
102+
- https://github.com/twbs/bootstrap/blob/e57a2f244ba8446fffe71847e6a58b18f7b2d541/scss/_variables.scss#L251
103+
- Use the font stack above rather than the `system-ui` font-family because of [issues](https://infinnie.github.io/blog/2017/systemui.html)
62104

63-
Use the system font for general instructional text.
105+
For main headers with an IPFS feel we use [Montserrat], as in the [example](#examples) above
64106

65107
```css
66-
.system-ui-font {
67-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
108+
.montserrat {
109+
font-family: 'Montserrat', 'Verdana', sans-serif;
68110
}
69111
```
70-
https://css-tricks.com/snippets/css/system-font-stack/
71-
72-
Provide the main content in a font that blends in with the users system, and is already installed.
73112

74113
### Font size
75114

@@ -147,14 +186,25 @@ followed by a _size_ from the scale, so:
147186
- `mb3`: margin bottom 3 = `margin-bottom: 1rem`
148187
- `pa2`: margin all 2 = `padding: 0.5rem`
149188

189+
Further reading:
190+
191+
- http://tachyons.io/docs
192+
- https://github.com/dwyl/learn-tachyons
193+
150194
## Credits
151195

152-
This style guide uses ideas from http://tachyons.io/docs/ and http://basscss.com/ and was inspired by https://airbnb.design/building-a-visual-language/
196+
This style guide is heavily based on http://tachyons.io/
153197

154198
## License
155199

156200
This repository is mainly for documents. All of these are licensed under the [CC-BY-SA 3.0](https://ipfs.io/ipfs/QmVreNvKsQmQZ83T86cWSjPu2vR3yZHGPm5jnxFuunEB9u) license © 2016 Protocol Labs Inc. Any code is under an [MIT license](LICENSE) © 2016 Protocol Labs Inc.
157201

202+
203+
[ipfs-css]: https://github.com/ipfs-shipyard/ipfs-css
158204
[ipfs.io]: https://ipfs.io
159205
[tachyons]: http://tachyons.io
160-
[tachyons type scale]: http://tachyons.io/docs/typography/scale/
206+
[tachyons type scale]: http://tachyons.io/docs/typography/scale
207+
[Parcel]: https://parceljs.org
208+
[create-react-app]: https://github.com/facebook/create-react-app
209+
[Montserrat]: https://github.com/JulietaUla/Montserrat
210+
[InterUI]: https://github.com/rsms/inter

img/header-cid-inspector.png

14.4 KB
Loading

0 commit comments

Comments
 (0)