@medyll/cssfabric 0.4.1 → 0.4.2
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 +50 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,38 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @medyll/cssfabric
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@medyll/cssfabric is a ready-to-use CSS utility className.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
If you're seeing this, you've probably already done this step. Congrats!
|
|
5
|
+
## Installation
|
|
8
6
|
|
|
7
|
+
install @medyll/cssfabric with your preferred package manager
|
|
9
8
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
|
|
9
|
+
npm install @medyll/cssfabric
|
|
10
|
+
# or
|
|
11
|
+
yarn add @medyll/cssfabric
|
|
12
|
+
# or whatever
|
|
13
|
+
...
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
## Developing
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
## Configuration
|
|
18
|
+
### Add `data-theme` attribute to `body`
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
npm run dev
|
|
20
|
+
Add the `data-theme` attribute to the `body` in your main html file:
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
```html
|
|
23
|
+
<body data-theme="dark">
|
|
24
|
+
<!-- Application content -->
|
|
25
|
+
</body>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
The `data-theme` attribute can be set to "dark" or "light" depending on your needs.
|
|
29
|
+
### Add imports from @medyll/cssfabric in the main file
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
Add the following imports in the main file:
|
|
31
32
|
|
|
32
|
-
```
|
|
33
|
-
|
|
33
|
+
```js
|
|
34
|
+
# example
|
|
35
|
+
import "@medyll/cssfabric/src/lib/styles/cssfabric.min.css";
|
|
36
|
+
# example for svelte
|
|
37
|
+
import "@medyll/cssfabric/src/lib/styles/cssfabric.min.css?inline";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Import your theme definition
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
# example for svelte
|
|
44
|
+
<style global lang="scss">
|
|
45
|
+
@import "path-to/own-cssfabric-theme.scss";
|
|
46
|
+
</style>
|
|
34
47
|
```
|
|
35
48
|
|
|
36
|
-
You can preview the production build with `npm run preview`.
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
Example of a scss theme definition:
|
|
51
|
+
|
|
52
|
+
```scss
|
|
53
|
+
// own-cssfabric-theme.scss
|
|
54
|
+
@charset "utf-8";
|
|
55
|
+
|
|
56
|
+
$theme-color-primary: #98B148;
|
|
57
|
+
$theme-color-secondary: #55492B;
|
|
58
|
+
$theme-color-tertiary: #9999CC;
|
|
59
|
+
|
|
60
|
+
$theme-dark-color-foreground: #f1f1f1;
|
|
61
|
+
$theme-dark-color-background: #27323a;
|
|
62
|
+
$theme-dark-color-paper: #3a3b3b;
|
|
63
|
+
|
|
64
|
+
// Overrides the default values of @medyll/cssfabric's configuration and deliver new `css properties`.
|
|
65
|
+
@import "../node_modules/@medyll/cssfabric/src/cssfabric/modules/vars.scss";
|
|
66
|
+
```
|