@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.
Files changed (2) hide show
  1. package/README.md +50 -22
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,66 @@
1
- # create-svelte
1
+ # @medyll/cssfabric
2
2
 
3
- Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
3
+ @medyll/cssfabric is a ready-to-use CSS utility className.
4
4
 
5
- ## Creating a project
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
- # create a new project in the current directory
11
- npm init svelte
12
-
13
- # create a new project in my-app
14
- npm init svelte my-app
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
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
17
+ ## Configuration
18
+ ### Add `data-theme` attribute to `body`
20
19
 
21
- ```bash
22
- npm run dev
20
+ Add the `data-theme` attribute to the `body` in your main html file:
23
21
 
24
- # or start the server and open the app in a new browser tab
25
- npm run dev -- --open
22
+ ```html
23
+ <body data-theme="dark">
24
+ <!-- Application content -->
25
+ </body>
26
26
  ```
27
27
 
28
- ## Building
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
- To create a production version of your app:
31
+ Add the following imports in the main file:
31
32
 
32
- ```bash
33
- npm run build
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
- > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medyll/cssfabric",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",