Skip to content

Commit 1ae4e70

Browse files
authored
add icon classes (#196)
add icon classes
2 parents c403a6d + c012eb0 commit 1ae4e70

File tree

14 files changed

+107
-115
lines changed

14 files changed

+107
-115
lines changed

addon/styles/addon.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@import "colors.css";
66
@import "helpers.css";
77
@import "layout.css";
8+
@import "icon.css";
89

910
@import "components/es-navbar.css";
1011
@import "components/es-header.css";

addon/styles/components/es-button.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.es-button {
22
background-color: var(--color-orange);
33
color: var(--color-light);
4-
font-size: var(--text-preset-2);
5-
padding-left: 8rem;
6-
padding-right: 8rem;
7-
padding-top: 2rem;
8-
padding-bottom: 2rem;
4+
padding-left: 1.5em;
5+
padding-right: 1.5em;
6+
padding-top: 1em;
7+
padding-bottom: 1em;
98
border-radius: 4px;
109
}
1110

addon/styles/global.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
--text-preset-1: 1.5rem;
1414
--text-preset-2: 2.5rem;
1515
--text-preset-3: 4rem;
16-
--text-preset-4: 8rem;
17-
--text-preset-5: 12rem;
16+
--text-preset-4: 6rem;
17+
--text-preset-5: 8rem;
1818
--font-weight-1: 300;
1919
--font-weight-2: 400;
2020
--font-weight-3: 600;
@@ -66,8 +66,6 @@ h6 {
6666

6767
/* move beyond this point */
6868

69-
70-
7169
.container {
7270
max-width: var(--container-width-large);
7371
margin-left: auto;

addon/styles/icon.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.icon-wrapper {
2+
display: inline-block;
3+
}
4+
5+
.circle {
6+
border-radius: 50%;
7+
padding: 1em;
8+
}
9+
10+
.icon {
11+
width: 1.5em;
12+
vertical-align: middle;
13+
}
14+
15+
.icon-left {
16+
margin-right: 0.5em;
17+
}
18+
19+
.icon-right {
20+
margin-left: 0.5em;
21+
}

docs/css/icons.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Icons
2+
3+
Icons are used to enhance the communication of concepts and to increase the discoverability of navigational paths.
4+
5+
## Accesibility Guidelines for Icons
6+
7+
1. Don't use icons by themselves, always pair an icon with text on the screen.
8+
2. Don't use the same icon to represent a different concept. Icons should have unambiguous meaning.
9+
3. All image-based icons should have an appropriate alt text attribute.
10+
11+
### Using icons
12+
13+
Icons are used inside an icon-wrapper that defines it's size and styling options such a circle background.
14+
15+
```html
16+
<div class="icon-wrapper margin-small">
17+
<img class="icon" src="/images/icons/bubble-icon.svg">
18+
</div>
19+
<div class="icon-wrapper circle bg-orange margin-small">
20+
<img class="icon" src="/images/icons/mic-icon.svg">
21+
</div>
22+
```
23+
24+
### Applying sizing to icons
25+
26+
```html
27+
<div class="icon-wrapper xsmall margin-xsmall">
28+
<img class="icon" alt="speech bubble" src="/images/icons/bubble-icon.svg">
29+
</div>
30+
<div class="icon-wrapper small margin-xsmall">
31+
<img class="icon" alt="speech bubble" src="/images/icons/bubble-icon.svg">
32+
</div>
33+
<div class="icon-wrapper medium margin-xsmall">
34+
<img class="icon" alt="speech bubble" src="/images/icons/bubble-icon.svg">
35+
</div>
36+
<div class="icon-wrapper large margin-xsmall">
37+
<img class="icon" alt="speech bubble" src="/images/icons/bubble-icon.svg">
38+
</div>
39+
<div class="icon-wrapper xlarge margin-xsmall">
40+
<img class="icon" alt="speech bubble" src="/images/icons/bubble-icon.svg">
41+
</div>
42+
```
43+
44+
### Using icons within components
45+
#### Button
46+
47+
```html
48+
<button class="es-button xsmall margin-bottom-small">
49+
<img class="icon icon-left" src="/images/icons/mic-icon.svg"> Click Me
50+
</button>
51+
52+
<button class="es-button small margin-bottom-small">
53+
Click Me <img class="icon icon-right" src="/images/icons/mic-icon.svg">
54+
</button>
55+
```
56+
57+
#### Card
58+
59+
```html
60+
<div class="card text-center margin-small">
61+
<div class="card-content">
62+
<div class="icon-wrapper medium circle bg-orange margin-small">
63+
<img class="icon" src="/images/icons/mic-icon.svg">
64+
</div>
65+
<h3>Podcasts</h3>
66+
<p>Rock n' Roll with EmberJS.</p>
67+
</div>
68+
</div>
69+
```
70+

public/images/icons/bubble-icon.svg

Lines changed: 1 addition & 0 deletions
Loading

public/images/icons/discord-logo.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 37 deletions
Loading

public/images/icons/fastly-logo.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)