anubis-ui 1.0.5 β 1.0.7
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 +58 -29
- package/package.json +12 -1
- package/src/tools/logger.ts +1 -1
- package/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -3,12 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
AnubisUI (Autonomous Nominative Utility Based Intuitive Styler) is a Vite plugin that provides dynamic CSS class generation based on configuration files. It automatically generates CSS rules by scanning your Vue files and mapping utility classes to their corresponding styles.
|
|
5
5
|
|
|
6
|
+
> __THIS DOESN'T WORK__ ```<div :class="`bg-primary-${props.bg || 'low'}\`" />```
|
|
7
|
+
> <br />
|
|
8
|
+
> Classes must be EXPLICITY written in the code to allow the extraction to work correctly, dynamic classes will not work
|
|
9
|
+
> <br />
|
|
10
|
+
> In the future, some config will allow to generate a bunch of specified classes even if not present in the code
|
|
11
|
+
> <br />
|
|
12
|
+
> Until then, you can create a decoy .vue file filled with the dynamic classes you want
|
|
13
|
+
> <br />
|
|
14
|
+
|
|
6
15
|
## Table of Contents
|
|
7
16
|
1. [Features](#features)
|
|
8
17
|
2. [Installation](#installation)
|
|
9
18
|
3. [Configuration](#configuration)
|
|
10
|
-
4. [
|
|
11
|
-
5. [
|
|
19
|
+
4. [Available Utility Classes](#available-utility-classes)
|
|
20
|
+
5. [Prefix/Declaration relations](#prefixdeclaration-relations)
|
|
21
|
+
6. [Architecture](#architecture)
|
|
22
|
+
7. [Credits](#credits)
|
|
12
23
|
|
|
13
24
|
## Features
|
|
14
25
|
- π¨ Dynamic CSS generation based on utility classes
|
|
@@ -48,14 +59,7 @@ css: [
|
|
|
48
59
|
```
|
|
49
60
|
<sup>quasar.config.js</sup>
|
|
50
61
|
|
|
51
|
-
|
|
52
|
-
4. Start adding classes to your *.vue files
|
|
53
|
-
```html
|
|
54
|
-
<div class="bg-primary border-neutral-low hover:shadow-low" />
|
|
55
|
-
```
|
|
56
|
-
<sup>any .vue file</sup>
|
|
57
|
-
|
|
58
|
-
5. Declare your project colors in the DOM ::root in anyway you want
|
|
62
|
+
4. Declare your project colors in the DOM ::root in anyway you want
|
|
59
63
|
<br />
|
|
60
64
|
Personnaly, i use the following method based on a mixin declaration
|
|
61
65
|
|
|
@@ -72,7 +76,7 @@ $background-opacity: (
|
|
|
72
76
|
90: 0.9
|
|
73
77
|
);
|
|
74
78
|
|
|
75
|
-
@mixin setGlobalColors($
|
|
79
|
+
@mixin setGlobalColors($name, $light, $dark) {
|
|
76
80
|
@include setRootColors($name, $light, 'body--light');
|
|
77
81
|
@include setRootColors($name, $dark, 'body--dark');
|
|
78
82
|
}
|
|
@@ -96,15 +100,29 @@ $background-opacity: (
|
|
|
96
100
|
```scss
|
|
97
101
|
@import './mixins';
|
|
98
102
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
@include
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
/**...highest... */
|
|
104
|
+
/**...higher... */
|
|
105
|
+
/**...high... */
|
|
106
|
+
@include setGlobalColors('primary', $blue-500, $blue-400);
|
|
107
|
+
/**...low... */
|
|
108
|
+
/**...lower... */
|
|
109
|
+
/**...lowest... */
|
|
110
|
+
|
|
111
|
+
@include setGlobalColors('secondary', $blue-grey-500, $blue-grey-400);
|
|
112
|
+
@include setGlobalColors('accent', $blue-500, $blue-400);
|
|
113
|
+
@include setGlobalColors('neutral', $slate-500, $slate-500);
|
|
114
|
+
@include setGlobalColors('success', $green-500, $green-400);
|
|
115
|
+
@include setGlobalColors('danger', $red-500, $red-400);
|
|
105
116
|
```
|
|
106
117
|
<sup>src/css/_colors_.scss</sup>
|
|
107
118
|
|
|
119
|
+
|
|
120
|
+
5. Start adding classes however you want to (in *.vue files)
|
|
121
|
+
```html
|
|
122
|
+
<div class="bg-primary border-neutral-low hover:shadow-low" />
|
|
123
|
+
```
|
|
124
|
+
<sup>any .vue file</sup>
|
|
125
|
+
|
|
108
126
|
6. Enjoy
|
|
109
127
|
|
|
110
128
|
## Configuration
|
|
@@ -128,6 +146,7 @@ Define your color palette
|
|
|
128
146
|
"warning",
|
|
129
147
|
"danger"
|
|
130
148
|
]
|
|
149
|
+
// no need to includes (lowest, lower, low, high, higher, highest) variants as long as the color name is present in the class
|
|
131
150
|
```
|
|
132
151
|
</details>
|
|
133
152
|
|
|
@@ -218,7 +237,8 @@ Define available states and style prefixes
|
|
|
218
237
|
- `bg-{color}` - Background color
|
|
219
238
|
- `text-{color}` - Text color
|
|
220
239
|
- `border-{color}` - Border color
|
|
221
|
-
- `
|
|
240
|
+
- `inner-border-{color}` - Inner border color (inset box shadow, not compatible with `shadow-`)
|
|
241
|
+
- `shadow-{color}` - Box shadow color (not compatible with `inner-border-`)
|
|
222
242
|
|
|
223
243
|
#### States
|
|
224
244
|
- `hover:{utility}` - Apply style on hover
|
|
@@ -230,25 +250,34 @@ Define available states and style prefixes
|
|
|
230
250
|
- `shadow-{color}-{preset}` - Box shadow spread
|
|
231
251
|
- `inner-border-{color}-{preset}` - Box shadow inset width
|
|
232
252
|
|
|
253
|
+
## Prefix/Declaration relations
|
|
254
|
+
| prefix | declaration |
|
|
255
|
+
|--------------|-----------------------------------------------------------------------------|
|
|
256
|
+
| bg | `background: {color} important;` |
|
|
257
|
+
| text | `color: {color} important;` |
|
|
258
|
+
| border | `border-width: {variation \|\| default} !important; border-color: {color} !important; border-style: solid;` |
|
|
259
|
+
| inner-border | `box-shadow: inset {variation \|\| default} {color} !important;` |
|
|
260
|
+
| shadow | `box-shadow: {variation \|\| default} {color} !important;` |
|
|
261
|
+
|
|
233
262
|
## Architecture
|
|
234
263
|
### Core Components
|
|
235
264
|
- **Vite Plugin**: Handles file watching and build process
|
|
236
265
|
- **Class Extractor**: Scans files for utility classes
|
|
237
266
|
- **Rule Generator**: Converts utility classes to CSS rules
|
|
238
|
-
- **Configuration System**: Manages user preferences and presets
|
|
267
|
+
- **Configuration System**: WIP - Manages user preferences and presets
|
|
239
268
|
|
|
240
269
|
### File Structure
|
|
241
270
|
```
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
βββ config/ # Configuration files
|
|
245
|
-
βββ interfaces/ # TypeScript interfaces
|
|
246
|
-
βββ manual/ # Manually trigger anubis actions
|
|
247
|
-
|
|
248
|
-
β
|
|
249
|
-
β
|
|
250
|
-
β
|
|
251
|
-
βββ index.
|
|
271
|
+
βββ dist/ # Compiled and generated output
|
|
272
|
+
βββ src/
|
|
273
|
+
β βββ config/ # Configuration files
|
|
274
|
+
β βββ interfaces/ # TypeScript interfaces
|
|
275
|
+
β βββ manual/ # Manually trigger anubis actions
|
|
276
|
+
β βββ tools/
|
|
277
|
+
β βββ extract/ # Class extraction logic
|
|
278
|
+
β βββ declaration/ # WIP - Style declaration handlers
|
|
279
|
+
β βββ mapping/ # Class to CSS rule mapping
|
|
280
|
+
βββ index.js # Plugin entry point
|
|
252
281
|
```
|
|
253
282
|
|
|
254
283
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anubis-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Class-based css generator",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"anubis",
|
|
8
|
+
"anubisUI",
|
|
9
|
+
"css",
|
|
10
|
+
"scss",
|
|
11
|
+
"style",
|
|
12
|
+
"plugin",
|
|
13
|
+
"vite",
|
|
14
|
+
"quasar",
|
|
15
|
+
"vue"
|
|
16
|
+
],
|
|
6
17
|
"scripts": {
|
|
7
18
|
"build": "tsc",
|
|
8
19
|
"preinstall": "npm run build"
|
package/src/tools/logger.ts
CHANGED