Skip to content

Commit 9b94e85

Browse files
author
Julio Ochoa
authored
Merge pull request #251 from Esri/jochoa/styles-readme
Added initial round of global styles readme
2 parents f318e8d + 8ca60b7 commit 9b94e85

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

src/assets/styles/readme.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Calcite global styles
2+
3+
When building any component in calcite-components or [calcite-app-components](https://github.com/esri/calcite-app-components), please use these set of global variables (CSS variables and Sass mixins or variables)
4+
5+
## From calcite-components
6+
7+
### Color
8+
9+
[`_colors.scss`](https://github.com/Esri/calcite-components/blob/master/src/assets/styles/_colors.scss): you'll find the global CSS variables for both light and dark theme.
10+
11+
## From [calcite-base](https://github.com/esri/calcite-base)
12+
13+
### Typography
14+
[typography mixins from calcite-base](https://github.com/Esri/calcite-base/blob/master/dist/_type.scss)
15+
16+
#### Font-size
17+
18+
Here are the most common use cases font-size (Sass):
19+
```
20+
@include font-size(1)
21+
@include font-size(0)
22+
@include font-size(-1)
23+
@include font-size(-2)
24+
@include font-size(-3)
25+
```
26+
The entire range is from font-size -3 to 8.
27+
28+
Example:
29+
30+
`font-size: @include font-size(-2)`
31+
32+
CSS ouput:
33+
```
34+
.font-size--2 {
35+
font-size: 0.875rem;
36+
line-height: 1.5;
37+
}
38+
```
39+
40+
#### Font-weight
41+
42+
| Weight | Value |
43+
|----------|---------|
44+
| Light | 300 |
45+
| Regular | 400 |
46+
| Medium | 500 |
47+
| Demi | 600 |
48+
49+
Example:
50+
`font-weight: 500`
51+
52+
53+
### Shadows
54+
55+
The shadow of an element usually corresponds to the priority or importance of the message or workflow. Consistently using shadow for elements like alerts, modals, page takeovers, and sheets provides users clear and familiar indications of importance.
56+
57+
```
58+
--shadow-1
59+
--shadow-1--hover
60+
--shadow-1--press
61+
--shadow-2
62+
--shadow-2--hover
63+
--shadow-2--press
64+
```
65+
66+
Current usage:
67+
68+
| Shadow 1 | Shadow 2 |
69+
|------------|--------------|
70+
| notice | Modals |
71+
| | Alerts |
72+
| | Tooltips |
73+
| | Dropdowns |
74+
| | Popovers |
75+
| | FAB |
76+
| | Date-picker |

0 commit comments

Comments
 (0)