@waaelg/dga-design-system 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.
@@ -0,0 +1,593 @@
1
+ # Colors β€” Quick Reference
2
+
3
+ Cheatsheet for common DGA color utilities. Full guide: [colors.md](./colors.md) Β· Swatches: [colors-swatches.md](./colors-swatches.md)
4
+
5
+ **Source:** `src/styles/utilities/colors.scss`
6
+
7
+ ---
8
+
9
+ ## 🎨 Color Palettes
10
+
11
+ ### Gray (Neutral)
12
+ ```
13
+ 25 β†’ #fcfcfd (Body BG)
14
+ 50 β†’ #f9fafb (Light BG)
15
+ 200 β†’ #e5e7eb (Borders)
16
+ 600 β†’ #4d5761 (Muted text)
17
+ 700 β†’ #384250 (Secondary text)
18
+ 950 β†’ #0d121c (Primary text)
19
+ ```
20
+
21
+ ### Primary (Saudi Green πŸ‡ΈπŸ‡¦)
22
+ ```
23
+ 500 β†’ #25935f ⭐ Main brand color
24
+ 600 β†’ #1b8354 (Hover)
25
+ 700 β†’ #166a45 (Active)
26
+ 800 β†’ #14573a (Brand text)
27
+ ```
28
+
29
+ ### Gold (Secondary)
30
+ ```
31
+ 500 β†’ #f5bd02 ⭐ Secondary color
32
+ 600 β†’ #dba102 (Hover)
33
+ ```
34
+
35
+ ### Semantic Colors
36
+ ```
37
+ Error β†’ #f04438 (Red)
38
+ Warning β†’ #f79009 (Orange)
39
+ Info β†’ #2e90fa (Blue)
40
+ Success β†’ #17b26a (Green)
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 🎯 Semantic Classes
46
+
47
+ ### Backgrounds
48
+ ```html
49
+ .dga-bg-primary <!-- Saudi Green -->
50
+ .dga-bg-secondary <!-- Gold -->
51
+ .dga-bg-success <!-- Green -->
52
+ .dga-bg-info <!-- Blue -->
53
+ .dga-bg-warning <!-- Orange -->
54
+ .dga-bg-danger <!-- Red -->
55
+ .dga-bg-light <!-- Light gray -->
56
+ .dga-bg-dark <!-- Dark gray -->
57
+ ```
58
+
59
+ ### Text Colors
60
+ ```html
61
+ .dga-text-primary <!-- Main text (gray-950) -->
62
+ .dga-text-secondary <!-- Secondary text (gray-700) -->
63
+ .dga-text-muted <!-- Muted text (gray-600) -->
64
+ .dga-text-white <!-- White -->
65
+ .dga-text-black <!-- Black -->
66
+ .dga-text-inverse <!-- White on dark -->
67
+ .dga-text-brand <!-- Brand text (SA-800) -->
68
+ .dga-text-error <!-- Error text -->
69
+ .dga-text-warning <!-- Warning text -->
70
+ .dga-text-success <!-- Success text -->
71
+ .dga-text-info <!-- Info text -->
72
+ ```
73
+
74
+ ### Borders
75
+ ```html
76
+ .dga-border-primary
77
+ .dga-border-secondary
78
+ .dga-border-success
79
+ .dga-border-danger
80
+ ```
81
+
82
+ ---
83
+
84
+ ## πŸ“Š Color Shade Classes
85
+
86
+ ### Pattern
87
+ ```html
88
+ .dga-{property}-{palette}-{shade}
89
+ ```
90
+
91
+ ### Examples
92
+ ```html
93
+ <!-- Text colors -->
94
+ .dga-text-primary-500 <!-- Saudi green text -->
95
+ .dga-text-gray-600 <!-- Gray text -->
96
+ .dga-text-error-700 <!-- Dark red text -->
97
+
98
+ <!-- Backgrounds -->
99
+ .dga-bg-primary-500 <!-- Saudi green BG -->
100
+ .dga-bg-gray-50 <!-- Light gray BG -->
101
+ .dga-bg-error-50 <!-- Light red BG -->
102
+
103
+ <!-- Borders -->
104
+ .dga-border-primary-300 <!-- Light green border -->
105
+ .dga-border-gray-200 <!-- Gray border -->
106
+ ```
107
+
108
+ ### All Palettes
109
+ - `gray` (25-950)
110
+ - `primary` (25-950)
111
+ - `gold` (25-950)
112
+ - `lavender` (25-950)
113
+ - `error` (25-950)
114
+ - `warning` (25-950)
115
+ - `info` (25-950)
116
+ - `success` (25-950)
117
+
118
+ ---
119
+
120
+ ## 🎨 Gradients
121
+
122
+ ```html
123
+ .dga-bg-gradient-primary <!-- Horizontal green -->
124
+ .dga-bg-gradient-secondary <!-- Diagonal green -->
125
+ .dga-bg-gradient-dark <!-- Dark to green -->
126
+ .dga-bg-gradient-medium <!-- Medium green -->
127
+ .dga-bg-gradient-subtle <!-- Subtle green -->
128
+ .dga-bg-gradient-deep <!-- Deep green -->
129
+ ```
130
+
131
+ ---
132
+
133
+ ## πŸ–±οΈ Hover States
134
+
135
+ ```html
136
+ <!-- Pattern -->
137
+ .dga-{property}-{color}-{shade}-hover
138
+
139
+ <!-- Examples -->
140
+ .dga-bg-primary-600-hover:hover
141
+ .dga-text-primary-700-hover:hover
142
+ .dga-border-gray-400-hover:hover
143
+ ```
144
+
145
+ ---
146
+
147
+ ## 🎯 Focus States
148
+
149
+ ```html
150
+ .dga-focus-ring <!-- Default (primary) -->
151
+ .dga-focus-ring-primary <!-- Primary focus -->
152
+ .dga-focus-ring-error <!-- Error focus -->
153
+ .dga-focus-ring-warning <!-- Warning focus -->
154
+ .dga-focus-ring-success <!-- Success focus -->
155
+ .dga-focus-ring-info <!-- Info focus -->
156
+ ```
157
+
158
+ ---
159
+
160
+ ## πŸ“ Border Utilities
161
+
162
+ ```html
163
+ .dga-border <!-- Default border (gray-200) -->
164
+ .dga-border-light <!-- Light border (gray-100) -->
165
+ .dga-border-top <!-- Top only -->
166
+ .dga-border-right <!-- Right only -->
167
+ .dga-border-bottom <!-- Bottom only -->
168
+ .dga-border-left <!-- Left only -->
169
+ .dga-border-none <!-- No border -->
170
+ ```
171
+
172
+ **Note:** Add `.dga-border` first, then color class:
173
+ ```html
174
+ <div class="dga-border dga-border-primary-500">
175
+ ```
176
+
177
+ ---
178
+
179
+ ## 🎯 Common Patterns
180
+
181
+ ### Alert Messages
182
+
183
+ #### Error
184
+ ```html
185
+ <div class="dga-bg-error-50 dga-border dga-border-error-200 dga-text-error-700">
186
+ Error message
187
+ </div>
188
+ ```
189
+
190
+ #### Warning
191
+ ```html
192
+ <div class="dga-bg-warning-50 dga-border dga-border-warning-200 dga-text-warning-700">
193
+ Warning message
194
+ </div>
195
+ ```
196
+
197
+ #### Success
198
+ ```html
199
+ <div class="dga-bg-success-50 dga-border dga-border-success-200 dga-text-success-700">
200
+ Success message
201
+ </div>
202
+ ```
203
+
204
+ #### Info
205
+ ```html
206
+ <div class="dga-bg-info-50 dga-border dga-border-info-200 dga-text-info-700">
207
+ Info message
208
+ </div>
209
+ ```
210
+
211
+ ---
212
+
213
+ ### Buttons
214
+
215
+ #### Primary
216
+ ```html
217
+ <button class="dga-bg-primary-500 dga-bg-primary-600-hover dga-text-white dga-focus-ring-primary">
218
+ Primary
219
+ </button>
220
+ ```
221
+
222
+ #### Secondary
223
+ ```html
224
+ <button class="dga-bg-white dga-border dga-border-primary-500 dga-text-primary-600 dga-bg-primary-50-hover">
225
+ Secondary
226
+ </button>
227
+ ```
228
+
229
+ #### Danger
230
+ ```html
231
+ <button class="dga-bg-error-500 dga-bg-error-600-hover dga-text-white dga-focus-ring-error">
232
+ Delete
233
+ </button>
234
+ ```
235
+
236
+ #### Ghost
237
+ ```html
238
+ <button class="dga-bg-transparent dga-text-primary-600 dga-text-primary-700-hover">
239
+ Ghost
240
+ </button>
241
+ ```
242
+
243
+ ---
244
+
245
+ ### Badges
246
+
247
+ ```html
248
+ <span class="dga-bg-primary-100 dga-text-primary-700">Active</span>
249
+ <span class="dga-bg-success-100 dga-text-success-700">Completed</span>
250
+ <span class="dga-bg-warning-100 dga-text-warning-700">Pending</span>
251
+ <span class="dga-bg-error-100 dga-text-error-700">Failed</span>
252
+ <span class="dga-bg-gray-100 dga-text-gray-700">Draft</span>
253
+ ```
254
+
255
+ ---
256
+
257
+ ### Form Inputs
258
+
259
+ #### Normal
260
+ ```html
261
+ <input class="dga-border dga-border-gray-300 dga-focus-ring-primary">
262
+ ```
263
+
264
+ #### Error
265
+ ```html
266
+ <input class="dga-border dga-border-error-500 dga-bg-error-50 dga-focus-ring-error">
267
+ <p class="dga-text-error-600">Error message</p>
268
+ ```
269
+
270
+ #### Success
271
+ ```html
272
+ <input class="dga-border dga-border-success-500 dga-bg-success-50">
273
+ <p class="dga-text-success-600">βœ“ Success message</p>
274
+ ```
275
+
276
+ ---
277
+
278
+ ### Cards
279
+
280
+ #### Basic Card
281
+ ```html
282
+ <div class="dga-bg-white dga-border dga-border-gray-200">
283
+ <div class="dga-bg-gray-50">
284
+ Header
285
+ </div>
286
+ <div>
287
+ Content
288
+ </div>
289
+ </div>
290
+ ```
291
+
292
+ #### Card with Gradient Header
293
+ ```html
294
+ <div class="dga-bg-white dga-border dga-border-gray-200">
295
+ <div class="dga-bg-gradient-primary dga-text-white">
296
+ Header
297
+ </div>
298
+ <div>
299
+ Content
300
+ </div>
301
+ </div>
302
+ ```
303
+
304
+ ---
305
+
306
+ ### Hero Sections
307
+
308
+ ```html
309
+ <section class="dga-bg-gradient-primary dga-text-white">
310
+ <h1>Welcome to DGA</h1>
311
+ <p class="dga-text-inverse-muted">Subtitle</p>
312
+ <button class="dga-bg-white dga-text-primary-600">
313
+ Get Started
314
+ </button>
315
+ </section>
316
+ ```
317
+
318
+ ---
319
+
320
+ ### Links
321
+
322
+ ```html
323
+ <!-- Default link -->
324
+ <a href="#" class="dga-text-primary-600 dga-text-primary-700-hover">
325
+ Link
326
+ </a>
327
+
328
+ <!-- Underlined link -->
329
+ <a href="#" class="dga-text-primary-600"
330
+ style="text-decoration: underline;">
331
+ Link
332
+ </a>
333
+
334
+ <!-- Link on dark background -->
335
+ <div class="dga-bg-dark">
336
+ <a href="#" class="dga-text-inverse dga-text-white-hover">
337
+ Link
338
+ </a>
339
+ </div>
340
+ ```
341
+
342
+ ---
343
+
344
+ ## βœ… Accessibility
345
+
346
+ ### Text Contrast
347
+
348
+ | Background | Use Text Color |
349
+ |------------|----------------|
350
+ | `bg-white` | `text-primary`, `text-secondary` |
351
+ | `bg-gray-50` | `text-primary` |
352
+ | `bg-primary-500` | `text-white` |
353
+ | `bg-dark` | `text-inverse` |
354
+ | `bg-error-50` | `text-error-700` |
355
+ | `bg-success-50` | `text-success-700` |
356
+
357
+ ### Good Combinations βœ…
358
+
359
+ ```html
360
+ <div class="dga-bg-white dga-text-primary">Good</div>
361
+ <div class="dga-bg-primary-500 dga-text-white">Good</div>
362
+ <div class="dga-bg-error-50 dga-text-error-700">Good</div>
363
+ ```
364
+
365
+ ### Poor Combinations ❌
366
+
367
+ ```html
368
+ <div class="dga-bg-gray-100 dga-text-gray-300">Poor</div>
369
+ <div class="dga-bg-primary-900 dga-text-primary-800">Poor</div>
370
+ ```
371
+
372
+ ---
373
+
374
+ ## πŸ“ SCSS Variables
375
+
376
+ ### Quick Access
377
+
378
+ ```scss
379
+ // Primary color
380
+ $dga-sa-500 // #25935f (Saudi Green)
381
+ $dga-semantic-primary // Same as above
382
+
383
+ // Text colors
384
+ $dga-text-primary // Gray 950
385
+ $dga-text-secondary // Gray 700
386
+ $dga-text-muted // Gray 600
387
+
388
+ // Semantic
389
+ $dga-semantic-success
390
+ $dga-semantic-error
391
+ $dga-semantic-warning
392
+ $dga-semantic-info
393
+
394
+ // Gradients
395
+ $dga-gradient-sa-primary
396
+ $dga-gradient-sa-dark
397
+
398
+ // Borders
399
+ $dga-border-color // Gray 200
400
+ $dga-border-color-light // Gray 100
401
+
402
+ // Body
403
+ $dga-body-bg // Gray 25
404
+ $dga-body-color // Text primary
405
+ ```
406
+
407
+ ---
408
+
409
+ ## 🎨 CSS Custom Properties
410
+
411
+ ### Access in CSS
412
+
413
+ ```css
414
+ .my-element {
415
+ background: var(--dga-primary-500);
416
+ color: var(--dga-gray-950);
417
+ border: 1px solid var(--dga-primary-300);
418
+ }
419
+ ```
420
+
421
+ ### JavaScript Access
422
+
423
+ ```javascript
424
+ // Get color
425
+ const green = getComputedStyle(document.documentElement)
426
+ .getPropertyValue('--dga-primary-500');
427
+
428
+ // Set color
429
+ document.documentElement.style
430
+ .setProperty('--dga-primary-500', '#custom');
431
+ ```
432
+
433
+ ---
434
+
435
+ ## πŸ’‘ Best Practices
436
+
437
+ ### Do's βœ…
438
+
439
+ - Use semantic classes for UI states
440
+ - Follow text hierarchy (primary β†’ secondary β†’ muted)
441
+ - Ensure WCAG AA contrast (4.5:1)
442
+ - Use light backgrounds for alerts
443
+ - Add focus states to interactive elements
444
+ - Use Saudi Green as primary brand color
445
+ - Use Gold sparingly as accent
446
+
447
+ ### Don'ts ❌
448
+
449
+ - Don't use light text on light backgrounds
450
+ - Don't use dark text on dark backgrounds
451
+ - Don't overuse gradients
452
+ - Don't mix too many colors in one UI
453
+ - Don't forget accessibility
454
+
455
+ ---
456
+
457
+ ## πŸ” Quick Debug
458
+
459
+ ### Color not working?
460
+ - βœ“ Class spelled correctly?
461
+ - βœ“ Using correct pattern?
462
+ - βœ“ Utilities imported?
463
+ - βœ“ Using `!important` override?
464
+
465
+ ### Poor contrast?
466
+ - βœ“ Check background/text combo
467
+ - βœ“ Use contrast checker
468
+ - βœ“ Follow recommended combinations
469
+
470
+ ### Hover not working?
471
+ - βœ“ Added `:hover` pseudo-class?
472
+ - βœ“ Using `-hover` suffix?
473
+ - βœ“ Element is interactive?
474
+
475
+ ---
476
+
477
+ ## πŸ“± All Generated Classes
478
+
479
+ ### Text Colors
480
+ ```
481
+ .dga-text-white
482
+ .dga-text-black
483
+ .dga-text-primary (gray-950)
484
+ .dga-text-secondary (gray-700)
485
+ .dga-text-muted (gray-600)
486
+ .dga-text-inverse (white)
487
+ .dga-text-inverse-muted (white 70%)
488
+ .dga-text-brand (SA-800)
489
+ .dga-text-brand-secondary (SA-600)
490
+ .dga-text-error
491
+ .dga-text-warning
492
+ .dga-text-success
493
+ .dga-text-info
494
+ .dga-text-danger
495
+ .dga-text-light
496
+ .dga-text-dark
497
+ .dga-text-{palette}-{shade} (96 colors)
498
+ ```
499
+
500
+ ### Background Colors
501
+ ```
502
+ .dga-bg-primary
503
+ .dga-bg-secondary
504
+ .dga-bg-success
505
+ .dga-bg-info
506
+ .dga-bg-warning
507
+ .dga-bg-danger
508
+ .dga-bg-light
509
+ .dga-bg-dark
510
+ .dga-bg-{palette}-{shade} (96 colors)
511
+ ```
512
+
513
+ ### Border Colors
514
+ ```
515
+ .dga-border
516
+ .dga-border-light
517
+ .dga-border-top/right/bottom/left
518
+ .dga-border-none
519
+ .dga-border-primary
520
+ .dga-border-secondary
521
+ .dga-border-{palette}-{shade} (96 colors)
522
+ ```
523
+
524
+ ### Gradients
525
+ ```
526
+ .dga-bg-gradient-primary
527
+ .dga-bg-gradient-secondary
528
+ .dga-bg-gradient-dark
529
+ .dga-bg-gradient-medium
530
+ .dga-bg-gradient-subtle
531
+ .dga-bg-gradient-deep
532
+ ```
533
+
534
+ ### Hover States
535
+ ```
536
+ .dga-{property}-{palette}-{shade}-hover:hover
537
+ ```
538
+
539
+ ### Focus States
540
+ ```
541
+ .dga-focus-ring
542
+ .dga-focus-ring-primary
543
+ .dga-focus-ring-error
544
+ .dga-focus-ring-warning
545
+ .dga-focus-ring-success
546
+ .dga-focus-ring-info
547
+ ```
548
+
549
+ ---
550
+
551
+ ## 🎯 Color Values Reference
552
+
553
+ ### Saudi Green Shades
554
+ ```
555
+ 25 β†’ #f7fdf9
556
+ 50 β†’ #f3fcf6
557
+ 100 β†’ #dff6e7
558
+ 200 β†’ #b8eacb
559
+ 300 β†’ #88d8ad
560
+ 400 β†’ #54c08a
561
+ 500 β†’ #25935f ⭐ MAIN
562
+ 600 β†’ #1b8354
563
+ 700 β†’ #166a45
564
+ 800 β†’ #14573a
565
+ 900 β†’ #104631
566
+ 950 β†’ #092a1e
567
+ ```
568
+
569
+ ### Semantic Values
570
+ ```
571
+ Primary β†’ #25935f (SA Green 500)
572
+ Secondary β†’ #f5bd02 (Gold 500)
573
+ Success β†’ #17b26a (Success 500)
574
+ Info β†’ #2e90fa (Info 500)
575
+ Warning β†’ #f79009 (Warning 500)
576
+ Danger β†’ #f04438 (Error 500)
577
+ Light β†’ #f9fafb (Gray 50)
578
+ Dark β†’ #111927 (Gray 900)
579
+ ```
580
+
581
+ ---
582
+
583
+ ## πŸ“– Resources
584
+
585
+ - **Full documentation:** [colors.md](./colors.md)
586
+ - **Primary Brand:** Saudi Green (#25935f)
587
+ - **Total Colors:** 96 shades across 8 palettes
588
+ - **Utility Classes:** 1000+ generated
589
+
590
+ ---
591
+
592
+ **Version:** 1.0.0
593
+ **Quick access to all DGA color utilities**