anubis-ui 1.0.1 → 1.0.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 +174 -2
- package/package.json +1 -1
- package/src/config/wip_presets.config.json +0 -47
- package/src/config/wip_selectors.config.json +0 -30
package/README.md
CHANGED
|
@@ -1,2 +1,174 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Anubis UI
|
|
2
|
+
> powered by [__Improba__](https://improba.fr/)
|
|
3
|
+
|
|
4
|
+
Anubis UI (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
|
+
|
|
6
|
+
## Table of Contents
|
|
7
|
+
1. [Features](#features)
|
|
8
|
+
2. [Installation](#installation)
|
|
9
|
+
3. [Configuration](#configuration)
|
|
10
|
+
4. [Usage](#usage)
|
|
11
|
+
5. [Architecture](#architecture)
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- 🎨 Dynamic CSS generation based on utility classes
|
|
15
|
+
- 🔄 Hot-reloading support through Vite plugin
|
|
16
|
+
- 📦 Configurable color system
|
|
17
|
+
- 🛠️ Customizable presets for:
|
|
18
|
+
- Background opacities
|
|
19
|
+
- Border widths
|
|
20
|
+
- Inner borders
|
|
21
|
+
- Shadows
|
|
22
|
+
- 🎯 State modifiers (hover, not-hover)
|
|
23
|
+
- 🔍 Smart class detection and parsing
|
|
24
|
+
|
|
25
|
+
# Installation
|
|
26
|
+
`npm install anubis-ui`
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
Anubis UI uses several configuration files located in the `src/config` directory:
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
### Colors (`colors.config.json`)
|
|
33
|
+
Define your color palette
|
|
34
|
+
<details>
|
|
35
|
+
<summary>Default config</summary>
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
[
|
|
39
|
+
"primary",
|
|
40
|
+
"secondary",
|
|
41
|
+
"accent",
|
|
42
|
+
"neutral",
|
|
43
|
+
"success",
|
|
44
|
+
"warning",
|
|
45
|
+
"danger"
|
|
46
|
+
]
|
|
47
|
+
```
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
### Files (`files.config.json`)
|
|
52
|
+
Specify which files to scan for classes
|
|
53
|
+
<details>
|
|
54
|
+
<summary>Default config</summary>
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"targets": [
|
|
59
|
+
"/.vue"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
### Presets (`presets.config.json`)
|
|
67
|
+
Configure common style presets
|
|
68
|
+
<details>
|
|
69
|
+
<summary>Default config</summary>
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"border": [
|
|
74
|
+
{ "default": "4px" },
|
|
75
|
+
{ "thinest": "1px" },
|
|
76
|
+
{ "thiner": "2px" },
|
|
77
|
+
{ "thin": "3px" },
|
|
78
|
+
{ "thick": "6px" },
|
|
79
|
+
{ "thicker": "8px" },
|
|
80
|
+
{ "thickest": "10px" },
|
|
81
|
+
],
|
|
82
|
+
|
|
83
|
+
"innerBorder": [
|
|
84
|
+
{ "default": "4px" },
|
|
85
|
+
{ "thinest": "1px" },
|
|
86
|
+
{ "thiner": "2px" },
|
|
87
|
+
{ "thin": "3px" },
|
|
88
|
+
{ "thick": "6px" },
|
|
89
|
+
{ "thicker": "8px" },
|
|
90
|
+
{ "thickest": "10px" },
|
|
91
|
+
],
|
|
92
|
+
|
|
93
|
+
"shadow": [
|
|
94
|
+
{ "default": "0px 0px 7px 1px" },
|
|
95
|
+
{ "densest": "0px 0px 3px 1px" },
|
|
96
|
+
{ "denser": "0px 0px 5px 1px" },
|
|
97
|
+
{ "dense": "0px 0px 5px 1px" },
|
|
98
|
+
{ "wide": "0px 0px 10px 1px" },
|
|
99
|
+
{ "wider": "0px 0px 15px 1px" },
|
|
100
|
+
{ "widest": "0px 0px 20px 1px" }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
---### Selectors (`selectors.config.json`)
|
|
108
|
+
Define available states and style prefixes
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary>Default config</summary>
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"states": [
|
|
116
|
+
"hover",
|
|
117
|
+
"not-hover"
|
|
118
|
+
],
|
|
119
|
+
"prefixes": [
|
|
120
|
+
"bg",
|
|
121
|
+
"text",
|
|
122
|
+
"border",
|
|
123
|
+
"inner-border",
|
|
124
|
+
"shadow"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
</details>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## Available Utility Classes
|
|
132
|
+
#### Colors
|
|
133
|
+
- `bg-{color}` - Background color
|
|
134
|
+
- `text-{color}` - Text color
|
|
135
|
+
- `border-{color}` - Border color
|
|
136
|
+
- `shadow-{color}` - Box shadow color
|
|
137
|
+
|
|
138
|
+
#### States
|
|
139
|
+
- `hover:{utility}` - Apply style on hover
|
|
140
|
+
- `not-hover:{utility}` - Apply style when not hovering
|
|
141
|
+
|
|
142
|
+
#### Presets
|
|
143
|
+
- `bg-{color}-{(10-90)}` - Background opacity
|
|
144
|
+
- `border-{color}-{preset}` - Border width
|
|
145
|
+
- `shadow-{color}-{preset}` - Box shadow spread
|
|
146
|
+
- `inner-border-{color}-{preset}` - Box shadow inset width
|
|
147
|
+
|
|
148
|
+
## Architecture
|
|
149
|
+
### Core Components
|
|
150
|
+
- **Vite Plugin**: Handles file watching and build process
|
|
151
|
+
- **Class Extractor**: Scans files for utility classes
|
|
152
|
+
- **Rule Generator**: Converts utility classes to CSS rules
|
|
153
|
+
- **Configuration System**: Manages user preferences and presets
|
|
154
|
+
|
|
155
|
+
### File Structure
|
|
156
|
+
```
|
|
157
|
+
</details>src/
|
|
158
|
+
|
|
159
|
+
├── config/ # Configuration files
|
|
160
|
+
├── interfaces/ # TypeScript interfaces
|
|
161
|
+
├── manual/ # Manually trigger anubis actions
|
|
162
|
+
├── tools/
|
|
163
|
+
│ ├── extract/ # Class extraction logic
|
|
164
|
+
│ ├── mapping/ # Class to CSS rule mapping
|
|
165
|
+
│ └── declaration/ # Style declaration handlers
|
|
166
|
+
└── index.ts # Plugin entry point
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## Credits
|
|
171
|
+
|
|
172
|
+
This project was made possible thanks to the support and resources provided by [__Improba__](https://improba.fr/).
|
|
173
|
+
<br />
|
|
174
|
+
Their trust and commitment played a key role in bringing this idea to life, and i'm grateful for their involvement in making it happen.
|
package/package.json
CHANGED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"defaultBorderRadius": "6px",
|
|
4
|
-
"borderRadiuses": [
|
|
5
|
-
{ "lessest": "2px" },
|
|
6
|
-
{ "lesser": "3px" },
|
|
7
|
-
{ "less": "4px" },
|
|
8
|
-
{ "more": "6px" },
|
|
9
|
-
{ "morer": "8px" },
|
|
10
|
-
{ "morest": "12px" },
|
|
11
|
-
{ "half": "25%" },
|
|
12
|
-
{ "full": "50%" }
|
|
13
|
-
],
|
|
14
|
-
|
|
15
|
-
"defaultBorderWidth": "4px",
|
|
16
|
-
"borderWidths": [
|
|
17
|
-
{ "thinest": "1px" },
|
|
18
|
-
{ "thiner": "2px" },
|
|
19
|
-
{ "thin": "3px" },
|
|
20
|
-
{ "thick": "6px" },
|
|
21
|
-
{ "thicker": "8px" },
|
|
22
|
-
{ "thickest": "10px" },
|
|
23
|
-
{ "node": "0.2rem" }
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
"defaultInnerBorderWidth": "4px",
|
|
27
|
-
"innerBorderWidths": [
|
|
28
|
-
{ "thinest": "1px" },
|
|
29
|
-
{ "thiner": "2px" },
|
|
30
|
-
{ "thin": "3px" },
|
|
31
|
-
{ "thick": "6px" },
|
|
32
|
-
{ "thicker": "8px" },
|
|
33
|
-
{ "thickest": "10px" },
|
|
34
|
-
{ "node": "0.2rem" }
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
"defaultShadow": "0px 0px 7px 1px",
|
|
38
|
-
"shadowWidths": [
|
|
39
|
-
{ "densest": "0px 0px 3px 1px" },
|
|
40
|
-
{ "denser": "0px 0px 5px 1px" },
|
|
41
|
-
{ "dense": "0px 0px 5px 1px" },
|
|
42
|
-
{ "wide": "0px 0px 10px 1px" },
|
|
43
|
-
{ "wider": "0px 0px 15px 1px" },
|
|
44
|
-
{ "widest": "0px 0px 20px 1px" }
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"states": [
|
|
3
|
-
{
|
|
4
|
-
"prefix": "hover",
|
|
5
|
-
"selector": ":hover"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"prefix": "not-hover",
|
|
9
|
-
"selector": ":not(:hover)"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"prefixes": [
|
|
13
|
-
{
|
|
14
|
-
"prefix": "bg",
|
|
15
|
-
"selector": "background: ${value} !important"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"prefix": "border",
|
|
19
|
-
"selector": "border-width: 1px; border-style: solid; border-color: ${value} !important"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"prefix": "inner-border",
|
|
23
|
-
"selector": "box-shadow: inset ${value} !important"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"prefix": "shadow",
|
|
27
|
-
"selector": "box-shadow: ${value} !important"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|