@massimo-cassandro/minimo 0.4.0 → 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.
@@ -127,12 +127,22 @@
127
127
  "background": {
128
128
  "color": {
129
129
  "$type": "color",
130
- "$value": "#999"
130
+ "$value": "#ddd"
131
131
  }
132
132
  },
133
+ "color": {
134
+ "$type": "color",
135
+ "$value": "#999"
136
+ },
133
137
  "opacity": {
134
138
  "$type": "number",
135
139
  "$value": ".3"
140
+ },
141
+ "font": {
142
+ "style": {
143
+ "$type": "string",
144
+ "$value": "italic"
145
+ }
136
146
  }
137
147
  },
138
148
  "required": {
@@ -0,0 +1,324 @@
1
+ export default {
2
+ form: {
3
+
4
+ label: {
5
+ 'font' : {
6
+ size: {
7
+ $value: '{font.size.sm}',
8
+ $type: 'dimension'
9
+ },
10
+ weight: {
11
+ $value: '{font.weight.semibold}',
12
+ $type: 'fontWeight'
13
+ }
14
+ },
15
+ color: {
16
+ $value: '{text.color}',
17
+ $type: 'color'
18
+ }
19
+ },
20
+ group: {
21
+ 'padding-block': {
22
+ $value: '0 {size.base}',
23
+ $type: 'dimension'
24
+ }
25
+ },
26
+ 'input-group': {
27
+ background: {
28
+ color: {
29
+ $value: 'transparent',
30
+ $type: 'color'
31
+ }
32
+ }
33
+ },
34
+
35
+ control: {
36
+ static: {
37
+ color: {
38
+ $value: '{form.control.text.color}',
39
+ $type: 'color'
40
+ },
41
+ background: {
42
+ color: {
43
+ $value: 'transparent',
44
+ $type: 'color'
45
+ }
46
+ }
47
+ },
48
+
49
+ text: {
50
+ color: {
51
+ $value: '{text.color}',
52
+ $type: 'color'
53
+ }
54
+ },
55
+
56
+ font: {
57
+ style: {
58
+ $value: 'normal',
59
+ $type: 'string'
60
+ },
61
+ weight: {
62
+ $value: '{font.weight.regular}',
63
+ $type: 'fontWeight'
64
+ },
65
+ size: {
66
+ $value: '{font.size.base}',
67
+ $type: 'dimension'
68
+ }
69
+ },
70
+
71
+ background: {
72
+ color: {
73
+ $value: '{body.background.color}',
74
+ $type: 'color'
75
+ }
76
+ },
77
+ 'line-height': {
78
+ $value: '1.2',
79
+ $type: 'number'
80
+ },
81
+
82
+ padding: {
83
+ inline: {
84
+ $value: '{size.sm}',
85
+ $type: 'dimension'
86
+ },
87
+ block: {
88
+ $value: '{size.xs}',
89
+ $type: 'dimension'
90
+ }
91
+ },
92
+
93
+ border: {
94
+ color: {
95
+ $value: '#666',
96
+ $type: 'color'
97
+ },
98
+ width: {
99
+ $value: '1px',
100
+ $type: 'dimension'
101
+ },
102
+ radius: {
103
+ $value: '{radius.xxs}',
104
+ $type: 'dimension'
105
+ }
106
+ },
107
+
108
+ placeholder: {
109
+ color: {
110
+ $value: '#666',
111
+ $type: 'color'
112
+ },
113
+ opacity: {
114
+ $value: 0.8,
115
+ $type: 'number'
116
+ },
117
+ font: {
118
+ size: {
119
+ $value: '{form.control.font.size}',
120
+ $type: 'dimension'
121
+ },
122
+ style: {
123
+ $value: 'italic',
124
+ $type: 'string'
125
+ }
126
+ }
127
+ },
128
+
129
+ disabled: {
130
+ background: {
131
+ color: {
132
+ $value: '#ddd',
133
+ $type: 'color'
134
+ }
135
+ },
136
+ color: {
137
+ $value: '#999',
138
+ $type: 'color'
139
+ },
140
+ opacity: {
141
+ $value: .7,
142
+ $type: 'number'
143
+ },
144
+ font: {
145
+ style: {
146
+ $value: 'italic',
147
+ $type: 'string'
148
+ }
149
+ }
150
+ },
151
+ required: {
152
+ 'flag-color': {
153
+ $value: '#c00',
154
+ $type: 'color'
155
+ },
156
+ 'flag-content': {
157
+ $value: '\'\\002A\'',
158
+ $type: 'string'
159
+ }
160
+ },
161
+ focus: {
162
+ color: {
163
+ $value: 'hsl(205 69% 45% / .508)',
164
+ $type: 'color'
165
+ },
166
+ outline: {
167
+ width: {
168
+ $value: '4px',
169
+ $type: 'dimension'
170
+ }
171
+ }
172
+ },
173
+
174
+ xs: {
175
+ font: {
176
+ size: {
177
+ $value: '{font.size.xs}',
178
+ $type: 'dimension'
179
+ }
180
+ },
181
+ padding: {
182
+ inline: {
183
+ $value: '{size.xxs}',
184
+ $type: 'dimension'
185
+ },
186
+ block: {
187
+ $value: '{size.xxs}',
188
+ $type: 'dimension'
189
+ }
190
+ }
191
+ },
192
+ sm: {
193
+ font: {
194
+ size: {
195
+ $value: '{font.size.sm}',
196
+ $type: 'dimension'
197
+ }
198
+ },
199
+ padding: {
200
+ inline: {
201
+ $value: '{size.xs}',
202
+ $type: 'dimension'
203
+ },
204
+ block: {
205
+ $value: '{size.xxs}',
206
+ $type: 'dimension'
207
+ }
208
+ }
209
+ },
210
+ md: {
211
+ font: {
212
+ size: {
213
+ $value: '{font.size.md}',
214
+ $type: 'dimension'
215
+ }
216
+ },
217
+ padding: {
218
+ inline: {
219
+ $value: '{size.sm}',
220
+ $type: 'dimension'
221
+ },
222
+ block: {
223
+ $value: '{size.xs}',
224
+ $type: 'dimension'
225
+ }
226
+ }
227
+ },
228
+ lg: {
229
+ font: {
230
+ size: {
231
+ $value: '{font.size.lg}',
232
+ $type: 'dimension'
233
+ }
234
+ },
235
+ padding: {
236
+ inline: {
237
+ $value: '{size.md}',
238
+ $type: 'dimension'
239
+ },
240
+ block: {
241
+ $value: '{size.base}',
242
+ $type: 'dimension'
243
+ }
244
+ }
245
+ },
246
+ xl: {
247
+ font: {
248
+ size: {
249
+ $value: '{font.size.xl}',
250
+ $type: 'dimension'
251
+ }
252
+ },
253
+ padding: {
254
+ inline: {
255
+ $value: '{size.xl}',
256
+ $type: 'dimension'
257
+ },
258
+ block: {
259
+ $value: '{size.md}',
260
+ $type: 'dimension'
261
+ }
262
+ }
263
+ },
264
+
265
+ // /* TODO importazione automatica SVG (NB problemi con svgo) */
266
+ // /* url('./css/forms/select-indicator.svg?cssInline'); */
267
+ select: {
268
+ 'trigger-icon': {
269
+ $value: 'url(\'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22rgb(5%2C%2048%2C%2056)%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m2%205%206%206%206-6%22%2F%3E%3C%2Fsvg%3E\')',
270
+ $type: 'string'
271
+ }
272
+ }
273
+ },
274
+
275
+ fieldset: {
276
+ border: {
277
+ width: {
278
+ $value: '1px',
279
+ $type: 'dimension'
280
+ }
281
+ },
282
+ },
283
+ legend: {
284
+ background: {
285
+ color: {
286
+ $value: 'transparent',
287
+ $type: 'color'
288
+ }
289
+ },
290
+ color: {
291
+ $value: '{text.color}',
292
+ $type: 'color'
293
+ }
294
+ },
295
+
296
+ // blocco info finali form
297
+ end: {
298
+ margin: {
299
+ block: {
300
+ start: {
301
+ $value: '{size.base}',
302
+ $type: 'dimension'
303
+ },
304
+ end: {
305
+ $value: '{size.base}',
306
+ $type: 'dimension'
307
+ }
308
+ }
309
+ }
310
+ },
311
+ 'user-info': {
312
+ font: {
313
+ size: {
314
+ $value: '{font.size.xs}',
315
+ $type: 'dimension'
316
+ }
317
+ },
318
+ color: {
319
+ $value: '{text.muted}',
320
+ $type: 'color'
321
+ }
322
+ }
323
+ }
324
+ };
@@ -8,6 +8,8 @@
8
8
  //
9
9
  // Usage: node check-unresolved-custom-props.mjs --config ./path/to/config.mjs
10
10
 
11
+ // TODO rimuovere/non generare file result se vuoto
12
+
11
13
  import path from 'path';
12
14
  import fs from 'node:fs';
13
15
  import { fileURLToPath, pathToFileURL } from 'url';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Light css framework",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/massimo-cassandro/minimo#readme",
@@ -11,7 +11,7 @@
11
11
  &:has(textarea) {
12
12
  height: 100%;
13
13
  }
14
-
14
+
15
15
  .grid & {
16
16
  padding-block-end: 0;
17
17
  }
@@ -4,7 +4,7 @@
4
4
  /* TODO classe grid specifica per i form ?? (.form-grid?) */
5
5
  /* TODO customizable select */
6
6
 
7
- .form-group:has([required]) .form-label {
7
+ .form-group:has([required]):not(:has([disabled])) .form-label {
8
8
  position: relative;
9
9
  padding-inline-start: var(--size-base);
10
10
  &::before {
@@ -45,17 +45,25 @@
45
45
  }
46
46
 
47
47
  &[disabled] {
48
- /* color: $form-select-disabled-color;
49
- background-color: $form-select-disabled-bg;
50
- border-color: $form-select-disabled-border-color; */
48
+ color: var(--form-control-disabled-color);
49
+ /* border-color: $form-select-disabled-border-color; */
50
+ cursor: not-allowed;
51
51
  background-color: var(--form-control-disabled-background-color);
52
- /* opacity: .6; */
53
- &::placeholder {
54
- font-style: italic;
52
+
53
+ &, &::placeholder {
54
+ font-style: var(--form-control-disabled-font-style);
55
55
  }
56
56
  }
57
57
  }
58
58
 
59
+ .form-group:has([disabled]) {
60
+ opacity: var(--form-control-disabled-opacity);
61
+ .form-label {
62
+ font-style: var(--form-control-disabled-font-style);
63
+ color: var(--form-control-disabled-color);
64
+ }
65
+ }
66
+
59
67
  .form-control, .form-control-static {
60
68
 
61
69
  padding: var(--form-control-padding-block) var(--form-control-padding-inline);
@@ -96,7 +96,9 @@
96
96
  --form-control-border-color: #666;
97
97
  --form-control-border-radius: var(--radius-xxs);
98
98
  --form-control-border-width: .0625rem;
99
- --form-control-disabled-background-color: #999;
99
+ --form-control-disabled-background-color: #ddd;
100
+ --form-control-disabled-color: #999;
101
+ --form-control-disabled-font-style: italic;
100
102
  --form-control-disabled-opacity: .3;
101
103
  --form-control-focus-color: hsl(205 69% 45% / .508);
102
104
  --form-control-focus-outline-width: .25rem;
@@ -1,314 +0,0 @@
1
- {
2
- "form": {
3
-
4
- "label": {
5
- "font" : {
6
- "size": {
7
- "$value": "{font.size.sm}",
8
- "$type": "dimension"
9
- },
10
- "weight": {
11
- "$value": "{font.weight.semibold}",
12
- "$type": "fontWeight"
13
- }
14
- },
15
- "color": {
16
- "$value": "{text.color}",
17
- "$type": "color"
18
- }
19
- },
20
- "group": {
21
- "padding-block": {
22
- "$value": "0 {size.base}",
23
- "$type": "dimension"
24
- }
25
- },
26
- "input-group": {
27
- "background": {
28
- "color": {
29
- "$value": "transparent",
30
- "$type": "color"
31
- }
32
- }
33
- },
34
-
35
- "control": {
36
- "static": {
37
- "color": {
38
- "$value": "{form.control.text.color}",
39
- "$type": "color"
40
- },
41
- "background": {
42
- "color": {
43
- "$value": "transparent",
44
- "$type": "color"
45
- }
46
- }
47
- },
48
-
49
- "text": {
50
- "color": {
51
- "$value": "{text.color}",
52
- "$type": "color"
53
- }
54
- },
55
-
56
- "font": {
57
- "style": {
58
- "$value": "normal",
59
- "$type": "string"
60
- },
61
- "weight": {
62
- "$value": "{font.weight.regular}",
63
- "$type": "fontWeight"
64
- },
65
- "size": {
66
- "$value": "{font.size.base}",
67
- "$type": "dimension"
68
- }
69
- },
70
-
71
- "background": {
72
- "color": {
73
- "$value": "{body.background.color}",
74
- "$type": "color"
75
- }
76
- },
77
- "line-height": {
78
- "$value": "1.2",
79
- "$type": "number"
80
- },
81
-
82
- "padding": {
83
- "inline": {
84
- "$value": "{size.sm}",
85
- "$type": "dimension"
86
- },
87
- "block": {
88
- "$value": "{size.xs}",
89
- "$type": "dimension"
90
- }
91
- },
92
-
93
- "border": {
94
- "color": {
95
- "$value": "#666",
96
- "$type": "color"
97
- },
98
- "width": {
99
- "$value": "1px",
100
- "$type": "dimension"
101
- },
102
- "radius": {
103
- "$value": "{radius.xxs}",
104
- "$type": "dimension"
105
- }
106
- },
107
-
108
- "placeholder": {
109
- "color": {
110
- "$value": "#666",
111
- "$type": "color"
112
- },
113
- "opacity": {
114
- "$value": 0.8,
115
- "$type": "number"
116
- },
117
- "font": {
118
- "size": {
119
- "$value": "{form.control.font.size}",
120
- "$type": "dimension"
121
- },
122
- "style": {
123
- "$value": "italic",
124
- "$type": "string"
125
- }
126
- }
127
- },
128
-
129
- "disabled": {
130
- "background": {
131
- "color": {
132
- "$value": "#999",
133
- "$type": "color"
134
- }
135
- },
136
- "opacity": {
137
- "$value": ".3",
138
- "$type": "number"
139
- }
140
- },
141
- "required": {
142
- "flag-color": {
143
- "$value": "#c00",
144
- "$type": "color"
145
- },
146
- "flag-content": {
147
- "$value": "'\\002A'",
148
- "$type": "string"
149
- }
150
- },
151
- "focus": {
152
- "color": {
153
- "$value": "hsl(205 69% 45% / .508)",
154
- "$type": "color"
155
- },
156
- "outline": {
157
- "width": {
158
- "$value": "4px",
159
- "$type": "dimension"
160
- }
161
- }
162
- },
163
-
164
- "xs": {
165
- "font": {
166
- "size": {
167
- "$value": "{font.size.xs}",
168
- "$type": "dimension"
169
- }
170
- },
171
- "padding": {
172
- "inline": {
173
- "$value": "{size.xxs}",
174
- "$type": "dimension"
175
- },
176
- "block": {
177
- "$value": "{size.xxs}",
178
- "$type": "dimension"
179
- }
180
- }
181
- },
182
- "sm": {
183
- "font": {
184
- "size": {
185
- "$value": "{font.size.sm}",
186
- "$type": "dimension"
187
- }
188
- },
189
- "padding": {
190
- "inline": {
191
- "$value": "{size.xs}",
192
- "$type": "dimension"
193
- },
194
- "block": {
195
- "$value": "{size.xxs}",
196
- "$type": "dimension"
197
- }
198
- }
199
- },
200
- "md": {
201
- "font": {
202
- "size": {
203
- "$value": "{font.size.md}",
204
- "$type": "dimension"
205
- }
206
- },
207
- "padding": {
208
- "inline": {
209
- "$value": "{size.sm}",
210
- "$type": "dimension"
211
- },
212
- "block": {
213
- "$value": "{size.xs}",
214
- "$type": "dimension"
215
- }
216
- }
217
- },
218
- "lg": {
219
- "font": {
220
- "size": {
221
- "$value": "{font.size.lg}",
222
- "$type": "dimension"
223
- }
224
- },
225
- "padding": {
226
- "inline": {
227
- "$value": "{size.md}",
228
- "$type": "dimension"
229
- },
230
- "block": {
231
- "$value": "{size.base}",
232
- "$type": "dimension"
233
- }
234
- }
235
- },
236
- "xl": {
237
- "font": {
238
- "size": {
239
- "$value": "{font.size.xl}",
240
- "$type": "dimension"
241
- }
242
- },
243
- "padding": {
244
- "inline": {
245
- "$value": "{size.xl}",
246
- "$type": "dimension"
247
- },
248
- "block": {
249
- "$value": "{size.md}",
250
- "$type": "dimension"
251
- }
252
- }
253
- },
254
-
255
- // /* TODO importazione automatica SVG (NB problemi con svgo) */
256
- // /* url('./css/forms/select-indicator.svg?cssInline'); */
257
- "select": {
258
- "trigger-icon": {
259
- "$value": "url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22rgb(5%2C%2048%2C%2056)%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m2%205%206%206%206-6%22%2F%3E%3C%2Fsvg%3E')",
260
- "$type": "string"
261
- }
262
- }
263
- },
264
-
265
- "fieldset": {
266
- "border": {
267
- "width": {
268
- "$value": "1px",
269
- "$type": "dimension"
270
- }
271
- },
272
- },
273
- "legend": {
274
- "background": {
275
- "color": {
276
- "$value": "transparent",
277
- "$type": "color"
278
- }
279
- },
280
- "color": {
281
- "$value": "{text.color}",
282
- "$type": "color"
283
- }
284
- },
285
-
286
- // blocco info finali form
287
- "end": {
288
- "margin": {
289
- "block": {
290
- "start": {
291
- "$value": "{size.base}",
292
- "$type": "dimension"
293
- },
294
- "end": {
295
- "$value": "{size.base}",
296
- "$type": "dimension"
297
- }
298
- }
299
- }
300
- },
301
- "user-info": {
302
- "font": {
303
- "size": {
304
- "$value": "{font.size.xs}",
305
- "$type": "dimension"
306
- }
307
- },
308
- "color": {
309
- "$value": "{text.muted}",
310
- "$type": "color"
311
- }
312
- }
313
- }
314
- }