@flodesk/grain 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -22
- package/es/base-styles.css +12 -4
- package/es/variables/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
# Grain design system
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Installation
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm run dev
|
|
9
|
-
# or
|
|
10
|
-
yarn dev
|
|
5
|
+
```
|
|
6
|
+
npm install @flodesk/grain
|
|
11
7
|
```
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
|
16
|
-
|
|
17
|
-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
|
9
|
+
### Add base styles
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
`base-styles.css` contains all Grain global styles. Import it in the highest component possible so that it's accessible everywhere in the UI.
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
```js
|
|
14
|
+
import "@flodesk/grain/es/base-styles.css";
|
|
15
|
+
```
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
## Usage
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
19
|
+
### Component usage
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
```jsx
|
|
22
|
+
import { Text, Button, Input } from "@flodesk/grain";
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
<Text>Content</Text>;
|
|
25
|
+
```
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
### CSS variable usage
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
```css
|
|
30
|
+
.dashboard-header {
|
|
31
|
+
font-size: var(--grn-text-xl);
|
|
32
|
+
margin-bottom: var(--grn-space-l);
|
|
33
|
+
color: var(--grn-color-bodyDimmed);
|
|
34
|
+
}
|
|
35
|
+
```
|
package/es/base-styles.css
CHANGED
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
:root {
|
|
29
|
-
--
|
|
29
|
+
--grey8-HSL: 0 0% 7%;
|
|
30
|
+
|
|
31
|
+
--grn-color-grey8: hsl(var(--grey8-HSL));
|
|
30
32
|
--grn-color-grey7: hsl(0 0% 20%);
|
|
31
33
|
--grn-color-grey6: hsl(0 0% 32%);
|
|
32
34
|
--grn-color-grey5: hsl(0 0% 44%);
|
|
@@ -35,12 +37,18 @@
|
|
|
35
37
|
--grn-color-grey2: hsl(0 0% 87%);
|
|
36
38
|
--grn-color-grey1: hsl(0 0% 96%);
|
|
37
39
|
|
|
40
|
+
--grn-color-blue: hsl(218 74% 54%);
|
|
41
|
+
--grn-color-red: hsl(6 66% 65%);
|
|
42
|
+
|
|
38
43
|
--grn-color-body: var(--grn-color-grey8);
|
|
39
|
-
--grn-color-bodyDimmed: hsl(
|
|
40
|
-
--grn-color-
|
|
44
|
+
--grn-color-bodyDimmed: hsl(var(--grey8-HSL) / 50%);
|
|
45
|
+
--grn-color-accent: var(--grn-color-grey8);
|
|
41
46
|
--grn-color-backgroundSecondary: hsl(0 0% 100%);
|
|
42
47
|
--grn-color-background: var(--grn-color-grey1);
|
|
43
|
-
--grn-color-
|
|
48
|
+
--grn-color-overlay: hsl(var(--grey8-HSL) / 7%);
|
|
49
|
+
--grn-color-border: hsl(var(--grey8-HSL) / 9%);
|
|
50
|
+
--grn-color-selection: var(--grn-color-blue);
|
|
51
|
+
--grn-color-danger: var(--grn-color-red);
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
* {
|
package/es/variables/index.js
CHANGED
|
@@ -31,10 +31,11 @@ for (var step = 1; step < greysAmount + 1; step++) {
|
|
|
31
31
|
|
|
32
32
|
export var grnPrefix = "--grn-";
|
|
33
33
|
export var greys = greysArray.reverse();
|
|
34
|
-
export var semanticColors = ["body", "bodyDimmed", "
|
|
34
|
+
export var semanticColors = ["body", "bodyDimmed", "accent", "backgroundSecondary", "background", "overlay", "border", "selection", "danger"];
|
|
35
|
+
export var baseColors = ["blue", "red"];
|
|
35
36
|
export var cssVarOptions = {
|
|
36
37
|
textSizes: ["s", "m", "l", "xl", "xxl"],
|
|
37
38
|
spaces: ["xs", "s", "m", "l", "xl", "xxl"],
|
|
38
39
|
weights: ["normal", "medium", "semiBold"],
|
|
39
|
-
colors: [].concat(_toConsumableArray(greys), semanticColors)
|
|
40
|
+
colors: [].concat(_toConsumableArray(greys), baseColors, semanticColors)
|
|
40
41
|
};
|