@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.
- package/README.md +480 -0
- package/docs/README.md +76 -0
- package/docs/changelog.md +54 -0
- package/docs/components/accordion.md +114 -0
- package/docs/components/alert.md +130 -0
- package/docs/components/avatar.md +74 -0
- package/docs/components/breadcrumb.md +56 -0
- package/docs/components/button.md +163 -0
- package/docs/components/card.md +78 -0
- package/docs/components/chart.md +97 -0
- package/docs/components/code-snippet.md +110 -0
- package/docs/components/divider.md +54 -0
- package/docs/components/forms.md +123 -0
- package/docs/components/link.md +52 -0
- package/docs/components/navbar.md +93 -0
- package/docs/components/table.md +69 -0
- package/docs/components/tag.md +76 -0
- package/docs/components/verify-bar.md +79 -0
- package/docs/foundations/colors-cheatsheet.md +593 -0
- package/docs/foundations/colors-swatches.md +441 -0
- package/docs/foundations/colors.md +1284 -0
- package/docs/foundations/grid.md +1406 -0
- package/docs/foundations/radius.md +1166 -0
- package/docs/foundations/spacing.md +134 -0
- package/docs/foundations/typography.md +111 -0
- package/docs/foundations/width-height.md +305 -0
- package/docs/getting-started/installation.md +158 -0
- package/docs/getting-started/javascript-api.md +204 -0
- package/docs/getting-started/rtl-arabic.md +89 -0
- package/docs/getting-started/web-components.md +134 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
# Grid & Flex
|
|
2
|
+
|
|
3
|
+
Responsive 12-column grid, flexbox utilities, display, gap, and layout helpers.
|
|
4
|
+
|
|
5
|
+
**Source:** `src/styles/utilities/grid.scss`, `src/styles/variables/grid.scss`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
1. [Overview](#overview)
|
|
12
|
+
2. [Quick start (npm)](#quick-start-npm)
|
|
13
|
+
3. [For contributors (SCSS)](#for-contributors-scss)
|
|
14
|
+
4. [Getting Started](#getting-started)
|
|
15
|
+
5. [Grid Basics](#grid-basics)
|
|
16
|
+
6. [Containers](#containers)
|
|
17
|
+
7. [Rows](#rows)
|
|
18
|
+
8. [Columns](#columns)
|
|
19
|
+
9. [Responsive Design](#responsive-design)
|
|
20
|
+
10. [Flexbox Utilities](#flexbox-utilities)
|
|
21
|
+
11. [Width & Height Utilities](#width--height-utilities)
|
|
22
|
+
12. [Spacing & Gaps](#spacing--gaps)
|
|
23
|
+
13. [Display Utilities](#display-utilities)
|
|
24
|
+
14. [Position Utilities](#position-utilities)
|
|
25
|
+
15. [Aspect Ratios](#aspect-ratios)
|
|
26
|
+
16. [Configuration](#configuration)
|
|
27
|
+
17. [Examples](#examples)
|
|
28
|
+
18. [Best Practices](#best-practices)
|
|
29
|
+
19. [Troubleshooting](#troubleshooting)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Overview
|
|
34
|
+
|
|
35
|
+
The DGA Grid System is a powerful, flexible, mobile-first grid framework built with SCSS. It provides:
|
|
36
|
+
|
|
37
|
+
- **12-column responsive grid** based on flexbox
|
|
38
|
+
- **6 responsive breakpoints** (xs, sm, md, lg, xl, xxl)
|
|
39
|
+
- **Configurable gutters** that adapt to screen size
|
|
40
|
+
- **Comprehensive utilities** for layout, spacing, sizing, and alignment
|
|
41
|
+
- **Dynamic generation** - easily customizable through SCSS variables
|
|
42
|
+
|
|
43
|
+
### Key Features
|
|
44
|
+
|
|
45
|
+
✅ Mobile-first responsive design
|
|
46
|
+
✅ Flexbox-based for modern browser support
|
|
47
|
+
✅ Consistent 12-column system across all breakpoints
|
|
48
|
+
✅ Dynamic gutter system (16px mobile, 32px desktop)
|
|
49
|
+
✅ Extensive flexbox utilities
|
|
50
|
+
✅ Width and height utility classes (`dga-w-*`, `dga-h-*`, `dga-min-h-screen`, etc.)
|
|
51
|
+
✅ Modern gap properties support
|
|
52
|
+
✅ Aspect ratio utilities
|
|
53
|
+
✅ Position and z-index utilities
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick start (npm)
|
|
58
|
+
|
|
59
|
+
Import the stylesheet once, then use layout classes in HTML:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import '@waaelg/dga-design-on-sass/style.css'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div class="dga-container">
|
|
67
|
+
<div class="dga-row">
|
|
68
|
+
<div class="dga-col-12 dga-col-md-6">Column A</div>
|
|
69
|
+
<div class="dga-col-12 dga-col-md-6">Column B</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="dga-d-flex dga-flex-column dga-gap-4">
|
|
74
|
+
<button class="dga-btn dga-btn-primary">Action</button>
|
|
75
|
+
</div>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
| Related | Doc |
|
|
79
|
+
|---------|-----|
|
|
80
|
+
| Spacing & padding | [spacing.md](./spacing.md) |
|
|
81
|
+
| Width & height | [width-height.md](./width-height.md) |
|
|
82
|
+
| SCSS customization | [Configuration](#configuration) (repo contributors) |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## For contributors (SCSS)
|
|
87
|
+
|
|
88
|
+
### 1. Include the SCSS Files
|
|
89
|
+
|
|
90
|
+
```scss
|
|
91
|
+
// Import variables first
|
|
92
|
+
@import 'path/to/variables/spacing';
|
|
93
|
+
@import 'path/to/variables/grid';
|
|
94
|
+
|
|
95
|
+
// Then import utilities
|
|
96
|
+
@import 'path/to/utilities/width';
|
|
97
|
+
@import 'path/to/utilities/height';
|
|
98
|
+
@import 'path/to/utilities/grid';
|
|
99
|
+
|
|
100
|
+
// Generate utilities
|
|
101
|
+
@include generate-all-width-utilities();
|
|
102
|
+
@include generate-all-height-utilities();
|
|
103
|
+
@include generate-all-grid-utilities();
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2. Or Generate Selectively
|
|
107
|
+
|
|
108
|
+
```scss
|
|
109
|
+
// Only generate what you need
|
|
110
|
+
@include generate-container-utilities();
|
|
111
|
+
@include generate-row-utilities();
|
|
112
|
+
@include generate-column-utilities();
|
|
113
|
+
@include generate-responsive-columns();
|
|
114
|
+
@include generate-flex-utilities();
|
|
115
|
+
@include generate-all-width-utilities();
|
|
116
|
+
@include generate-all-height-utilities();
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Getting Started
|
|
122
|
+
|
|
123
|
+
### Basic Grid Structure
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<div class="dga-container">
|
|
127
|
+
<div class="dga-row">
|
|
128
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
129
|
+
Column 1
|
|
130
|
+
</div>
|
|
131
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
132
|
+
Column 2
|
|
133
|
+
</div>
|
|
134
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
135
|
+
Column 3
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### How It Works
|
|
142
|
+
|
|
143
|
+
1. **Container** - Centers and constrains your content
|
|
144
|
+
2. **Row** - Creates a flex container with negative margins for gutters
|
|
145
|
+
3. **Columns** - Flex items that respond to different screen sizes
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Grid Basics
|
|
150
|
+
|
|
151
|
+
### The 12-Column System
|
|
152
|
+
|
|
153
|
+
The grid divides horizontal space into 12 equal columns:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
|
|
157
|
+
│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│ 9│10│11│12│
|
|
158
|
+
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- `.dga-col-6` = 6/12 = 50% width
|
|
162
|
+
- `.dga-col-4` = 4/12 = 33.33% width
|
|
163
|
+
- `.dga-col-3` = 3/12 = 25% width
|
|
164
|
+
|
|
165
|
+
### Breakpoints
|
|
166
|
+
|
|
167
|
+
| Breakpoint | Class Infix | Dimensions | Device |
|
|
168
|
+
|------------|-------------|------------|--------|
|
|
169
|
+
| Extra small | (none) | <576px | Mobile portrait |
|
|
170
|
+
| Small | `sm` | ≥576px | Mobile landscape |
|
|
171
|
+
| Medium | `md` | ≥768px | Tablets |
|
|
172
|
+
| Large | `lg` | ≥992px | Desktops |
|
|
173
|
+
| Extra large | `xl` | ≥1200px | Large desktops |
|
|
174
|
+
| Extra extra large | `xxl` | ≥1280px | Larger desktops |
|
|
175
|
+
|
|
176
|
+
### Gutter System
|
|
177
|
+
|
|
178
|
+
Gutters (spacing between columns) adapt to screen size:
|
|
179
|
+
|
|
180
|
+
| Breakpoint | Gutter Size | Per Side |
|
|
181
|
+
|------------|-------------|----------|
|
|
182
|
+
| xs | 16px | 8px |
|
|
183
|
+
| sm | 16px | 8px |
|
|
184
|
+
| md+ | 32px | 16px |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Containers
|
|
189
|
+
|
|
190
|
+
Containers center and constrain your content with responsive padding.
|
|
191
|
+
|
|
192
|
+
### Standard Container
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<div class="dga-container">
|
|
196
|
+
<!-- Content constrained to max-width with padding -->
|
|
197
|
+
</div>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Behavior:**
|
|
201
|
+
- Max-width at xxl: 1280px
|
|
202
|
+
- Responsive padding: 16px (mobile) → 32px (desktop)
|
|
203
|
+
- Centered with `margin: 0 auto`
|
|
204
|
+
|
|
205
|
+
### Fluid Container
|
|
206
|
+
|
|
207
|
+
```html
|
|
208
|
+
<div class="dga-container-fluid">
|
|
209
|
+
<!-- Full-width with padding, no max-width -->
|
|
210
|
+
</div>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Device-Specific Containers
|
|
214
|
+
|
|
215
|
+
```html
|
|
216
|
+
<!-- Desktop optimized (1280px max) -->
|
|
217
|
+
<div class="dga-container-desktop">
|
|
218
|
+
...
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<!-- Tablet optimized (768px max) -->
|
|
222
|
+
<div class="dga-container-tablet">
|
|
223
|
+
...
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<!-- Mobile optimized (375px max) -->
|
|
227
|
+
<div class="dga-container-mobile">
|
|
228
|
+
...
|
|
229
|
+
</div>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Breakpoint Containers
|
|
233
|
+
|
|
234
|
+
```html
|
|
235
|
+
<!-- Max-width applied at specific breakpoint -->
|
|
236
|
+
<div class="dga-container-md">
|
|
237
|
+
<!-- Max-width: 720px at md+ -->
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div class="dga-container-lg">
|
|
241
|
+
<!-- Max-width: 960px at lg+ -->
|
|
242
|
+
</div>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Rows
|
|
248
|
+
|
|
249
|
+
Rows are flex containers that hold columns.
|
|
250
|
+
|
|
251
|
+
### Basic Row
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<div class="dga-row">
|
|
255
|
+
<div class="dga-col">Column</div>
|
|
256
|
+
<div class="dga-col">Column</div>
|
|
257
|
+
</div>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### No Gutters
|
|
261
|
+
|
|
262
|
+
```html
|
|
263
|
+
<div class="dga-row dga-no-gutters">
|
|
264
|
+
<!-- Columns with no spacing between them -->
|
|
265
|
+
</div>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Custom Gutter Sizes
|
|
269
|
+
|
|
270
|
+
```html
|
|
271
|
+
<!-- Small gutters -->
|
|
272
|
+
<div class="dga-row-gap-sm">
|
|
273
|
+
<div class="dga-col">Column</div>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<!-- Large gutters -->
|
|
277
|
+
<div class="dga-row-gap-lg">
|
|
278
|
+
<div class="dga-col">Column</div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- Extra large gutters -->
|
|
282
|
+
<div class="dga-row-gap-xl">
|
|
283
|
+
<div class="dga-col">Column</div>
|
|
284
|
+
</div>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Columns
|
|
290
|
+
|
|
291
|
+
### Equal Width Columns
|
|
292
|
+
|
|
293
|
+
```html
|
|
294
|
+
<div class="dga-row">
|
|
295
|
+
<div class="dga-col">1 of 3</div>
|
|
296
|
+
<div class="dga-col">2 of 3</div>
|
|
297
|
+
<div class="dga-col">3 of 3</div>
|
|
298
|
+
</div>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
All columns share equal space.
|
|
302
|
+
|
|
303
|
+
### Fixed Width Columns
|
|
304
|
+
|
|
305
|
+
```html
|
|
306
|
+
<div class="dga-row">
|
|
307
|
+
<div class="dga-col-6">50% width</div>
|
|
308
|
+
<div class="dga-col-3">25% width</div>
|
|
309
|
+
<div class="dga-col-3">25% width</div>
|
|
310
|
+
</div>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Available classes: `.dga-col-1` through `.dga-col-12`
|
|
314
|
+
|
|
315
|
+
### Auto Width Columns
|
|
316
|
+
|
|
317
|
+
```html
|
|
318
|
+
<div class="dga-row">
|
|
319
|
+
<div class="dga-col">Flexible</div>
|
|
320
|
+
<div class="dga-col-auto">Fits content</div>
|
|
321
|
+
<div class="dga-col">Flexible</div>
|
|
322
|
+
</div>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Column Offsets
|
|
326
|
+
|
|
327
|
+
```html
|
|
328
|
+
<!-- Offset by 2 columns (push right) -->
|
|
329
|
+
<div class="dga-col-6 dga-offset-3">
|
|
330
|
+
Centered with offset
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
<!-- Offset by 4 columns -->
|
|
334
|
+
<div class="dga-col-4 dga-offset-4">
|
|
335
|
+
Offset 4 columns
|
|
336
|
+
</div>
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Available: `.dga-offset-0` through `.dga-offset-11`
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Responsive Design
|
|
344
|
+
|
|
345
|
+
### Mobile-First Approach
|
|
346
|
+
|
|
347
|
+
Classes apply to screen sizes equal to or larger than the breakpoint.
|
|
348
|
+
|
|
349
|
+
```html
|
|
350
|
+
<!-- Stack on mobile, 2 columns on tablet, 4 columns on desktop -->
|
|
351
|
+
<div class="dga-row">
|
|
352
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-3">
|
|
353
|
+
Card 1
|
|
354
|
+
</div>
|
|
355
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-3">
|
|
356
|
+
Card 2
|
|
357
|
+
</div>
|
|
358
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-3">
|
|
359
|
+
Card 3
|
|
360
|
+
</div>
|
|
361
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-3">
|
|
362
|
+
Card 4
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Behavior:**
|
|
368
|
+
- **Mobile (<768px):** All cards stack (100% width each)
|
|
369
|
+
- **Tablet (≥768px):** 2 cards per row (50% width each)
|
|
370
|
+
- **Desktop (≥992px):** 4 cards per row (25% width each)
|
|
371
|
+
|
|
372
|
+
### Responsive Column Classes
|
|
373
|
+
|
|
374
|
+
All breakpoint column classes available:
|
|
375
|
+
|
|
376
|
+
```html
|
|
377
|
+
<!-- Base (mobile first) -->
|
|
378
|
+
.dga-col-{1-12}
|
|
379
|
+
|
|
380
|
+
<!-- Small and up -->
|
|
381
|
+
.dga-col-sm-{1-12}
|
|
382
|
+
|
|
383
|
+
<!-- Medium and up -->
|
|
384
|
+
.dga-col-md-{1-12}
|
|
385
|
+
|
|
386
|
+
<!-- Large and up -->
|
|
387
|
+
.dga-col-lg-{1-12}
|
|
388
|
+
|
|
389
|
+
<!-- Extra large and up -->
|
|
390
|
+
.dga-col-xl-{1-12}
|
|
391
|
+
|
|
392
|
+
<!-- Extra extra large and up -->
|
|
393
|
+
.dga-col-xxl-{1-12}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Responsive Offsets
|
|
397
|
+
|
|
398
|
+
```html
|
|
399
|
+
<!-- Center on tablet and up -->
|
|
400
|
+
<div class="dga-col-12 dga-col-md-6 dga-offset-md-3">
|
|
401
|
+
Centered on tablet+
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
<!-- Different offsets at different sizes -->
|
|
405
|
+
<div class="dga-col-6 dga-offset-3 dga-offset-lg-2">
|
|
406
|
+
Offset changes at large screens
|
|
407
|
+
</div>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Responsive Auto Width
|
|
411
|
+
|
|
412
|
+
```html
|
|
413
|
+
<div class="dga-row">
|
|
414
|
+
<div class="dga-col-12 dga-col-md-auto">
|
|
415
|
+
Auto width on tablet+
|
|
416
|
+
</div>
|
|
417
|
+
<div class="dga-col-12 dga-col-md">
|
|
418
|
+
Fills remaining space
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Flexbox Utilities
|
|
426
|
+
|
|
427
|
+
Powerful utilities for controlling flex layouts.
|
|
428
|
+
|
|
429
|
+
### Flex Direction
|
|
430
|
+
|
|
431
|
+
| Class | CSS |
|
|
432
|
+
|-------|-----|
|
|
433
|
+
| `dga-flex-row` | `flex-direction: row` |
|
|
434
|
+
| `dga-flex-row-reverse` | `flex-direction: row-reverse` |
|
|
435
|
+
| `dga-flex-col` or `dga-flex-column` | `flex-direction: column` |
|
|
436
|
+
| `dga-flex-col-reverse` or `dga-flex-column-reverse` | `flex-direction: column-reverse` |
|
|
437
|
+
|
|
438
|
+
```html
|
|
439
|
+
<!-- Row (horizontal) -->
|
|
440
|
+
<div class="dga-d-flex dga-flex-row">
|
|
441
|
+
<div>Item 1</div>
|
|
442
|
+
<div>Item 2</div>
|
|
443
|
+
</div>
|
|
444
|
+
|
|
445
|
+
<!-- Column (vertical) -->
|
|
446
|
+
<div class="dga-d-flex dga-flex-column">
|
|
447
|
+
<div>Item 1</div>
|
|
448
|
+
<div>Item 2</div>
|
|
449
|
+
</div>
|
|
450
|
+
|
|
451
|
+
<!-- Reverse direction -->
|
|
452
|
+
<div class="dga-d-flex dga-flex-row-reverse">
|
|
453
|
+
<div>Item 1</div>
|
|
454
|
+
<div>Item 2</div>
|
|
455
|
+
</div>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Responsive:**
|
|
459
|
+
```html
|
|
460
|
+
<!-- Column on mobile, row on desktop -->
|
|
461
|
+
<div class="dga-d-flex dga-flex-column dga-flex-lg-row">
|
|
462
|
+
...
|
|
463
|
+
</div>
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Justify Content (Horizontal Alignment)
|
|
467
|
+
|
|
468
|
+
| Class | CSS value |
|
|
469
|
+
|-------|-----------|
|
|
470
|
+
| `dga-justify-content-start` | `flex-start` |
|
|
471
|
+
| `dga-justify-content-end` | `flex-end` |
|
|
472
|
+
| `dga-justify-content-center` | `center` |
|
|
473
|
+
| `dga-justify-content-between` | `space-between` |
|
|
474
|
+
| `dga-justify-content-around` | `space-around` |
|
|
475
|
+
| `dga-justify-content-evenly` | `space-evenly` |
|
|
476
|
+
|
|
477
|
+
> `stretch` is **not** valid for `justify-content`. Use `dga-align-items-stretch` for cross-axis stretching.
|
|
478
|
+
|
|
479
|
+
```html
|
|
480
|
+
<!-- Start (default) -->
|
|
481
|
+
<div class="dga-d-flex dga-justify-content-start">...</div>
|
|
482
|
+
|
|
483
|
+
<!-- End -->
|
|
484
|
+
<div class="dga-d-flex dga-justify-content-end">...</div>
|
|
485
|
+
|
|
486
|
+
<!-- Center -->
|
|
487
|
+
<div class="dga-d-flex dga-justify-content-center">...</div>
|
|
488
|
+
|
|
489
|
+
<!-- Space between -->
|
|
490
|
+
<div class="dga-d-flex dga-justify-content-between">...</div>
|
|
491
|
+
|
|
492
|
+
<!-- Space around -->
|
|
493
|
+
<div class="dga-d-flex dga-justify-content-around">...</div>
|
|
494
|
+
|
|
495
|
+
<!-- Space evenly -->
|
|
496
|
+
<div class="dga-d-flex dga-justify-content-evenly">...</div>
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
**Responsive:**
|
|
500
|
+
```html
|
|
501
|
+
<div class="dga-d-flex dga-justify-content-start dga-justify-content-md-center">
|
|
502
|
+
Start on mobile, center on tablet+
|
|
503
|
+
</div>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### Align Items (Vertical Alignment)
|
|
507
|
+
|
|
508
|
+
```html
|
|
509
|
+
<!-- Start (top) -->
|
|
510
|
+
<div class="dga-d-flex dga-align-items-start">...</div>
|
|
511
|
+
|
|
512
|
+
<!-- End (bottom) -->
|
|
513
|
+
<div class="dga-d-flex dga-align-items-end">...</div>
|
|
514
|
+
|
|
515
|
+
<!-- Center (middle) -->
|
|
516
|
+
<div class="dga-d-flex dga-align-items-center">...</div>
|
|
517
|
+
|
|
518
|
+
<!-- Baseline -->
|
|
519
|
+
<div class="dga-d-flex dga-align-items-baseline">...</div>
|
|
520
|
+
|
|
521
|
+
<!-- Stretch (default) -->
|
|
522
|
+
<div class="dga-d-flex dga-align-items-stretch">...</div>
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### Align Self (Individual Item Alignment)
|
|
526
|
+
|
|
527
|
+
```html
|
|
528
|
+
<div class="dga-d-flex">
|
|
529
|
+
<div class="dga-align-self-start">Aligned to top</div>
|
|
530
|
+
<div class="dga-align-self-center">Aligned to middle</div>
|
|
531
|
+
<div class="dga-align-self-end">Aligned to bottom</div>
|
|
532
|
+
</div>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Flex Wrap
|
|
536
|
+
|
|
537
|
+
```html
|
|
538
|
+
<!-- Allow wrapping -->
|
|
539
|
+
<div class="dga-d-flex dga-flex-wrap">...</div>
|
|
540
|
+
|
|
541
|
+
<!-- Prevent wrapping -->
|
|
542
|
+
<div class="dga-d-flex dga-flex-nowrap">...</div>
|
|
543
|
+
|
|
544
|
+
<!-- Reverse wrap -->
|
|
545
|
+
<div class="dga-d-flex dga-flex-wrap-reverse">...</div>
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**Responsive:**
|
|
549
|
+
```html
|
|
550
|
+
<div class="dga-d-flex dga-flex-nowrap dga-flex-md-wrap">
|
|
551
|
+
No wrap on mobile, wrap on tablet+
|
|
552
|
+
</div>
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### Flex Grow & Shrink
|
|
556
|
+
|
|
557
|
+
```html
|
|
558
|
+
<!-- Fill available space -->
|
|
559
|
+
<div class="dga-flex-fill">Grows to fill</div>
|
|
560
|
+
|
|
561
|
+
<!-- Control growing -->
|
|
562
|
+
<div class="dga-flex-grow-0">Won't grow</div>
|
|
563
|
+
<div class="dga-flex-grow-1">Will grow</div>
|
|
564
|
+
|
|
565
|
+
<!-- Control shrinking -->
|
|
566
|
+
<div class="dga-flex-shrink-0">Won't shrink</div>
|
|
567
|
+
<div class="dga-flex-shrink-1">Will shrink</div>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Centering Content
|
|
571
|
+
|
|
572
|
+
```html
|
|
573
|
+
<!-- Horizontally and vertically centered -->
|
|
574
|
+
<div class="dga-d-flex dga-justify-content-center dga-align-items-center dga-min-h-screen">
|
|
575
|
+
<div>Perfectly centered content</div>
|
|
576
|
+
</div>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
## Width & Height Utilities
|
|
582
|
+
|
|
583
|
+
Fixed, percentage, and viewport sizing utilities complement the grid and flexbox system.
|
|
584
|
+
|
|
585
|
+
### Quick reference
|
|
586
|
+
|
|
587
|
+
| Goal | Class |
|
|
588
|
+
|------|-------|
|
|
589
|
+
| Full width | `dga-w-full` or `dga-w-100` |
|
|
590
|
+
| Full height | `dga-h-full` or `dga-h-100` |
|
|
591
|
+
| Viewport width | `dga-w-screen` (`100vw`) |
|
|
592
|
+
| Viewport height | `dga-h-screen` or `dga-min-h-screen` (`100vh`) |
|
|
593
|
+
| Named size | `dga-w-lg`, `dga-h-md`, etc. |
|
|
594
|
+
| Spacing scale | `dga-w-4`, `dga-h-16` (4px base) |
|
|
595
|
+
| Max / min | `dga-max-w-3xl`, `dga-min-h-screen` |
|
|
596
|
+
|
|
597
|
+
```html
|
|
598
|
+
<!-- Full viewport hero -->
|
|
599
|
+
<section class="dga-d-flex dga-align-items-center dga-justify-content-center dga-min-h-screen">
|
|
600
|
+
<h1>Welcome</h1>
|
|
601
|
+
</section>
|
|
602
|
+
|
|
603
|
+
<!-- Card with fixed image height -->
|
|
604
|
+
<div class="dga-w-full dga-h-48 dga-bg-gray-100"></div>
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
See **[Width & Height](./width-height.md)** for the complete class list, named sizes, fractions, and troubleshooting.
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
## Spacing & Gaps
|
|
612
|
+
|
|
613
|
+
Modern gap utilities for spacing between flex/grid children.
|
|
614
|
+
|
|
615
|
+
### Gap (All Directions)
|
|
616
|
+
|
|
617
|
+
```html
|
|
618
|
+
<!-- Gap based on named sizes -->
|
|
619
|
+
<div class="dga-d-flex dga-gap-xs">Small gap</div>
|
|
620
|
+
<div class="dga-d-flex dga-gap-sm">Small-medium gap</div>
|
|
621
|
+
<div class="dga-d-flex dga-gap-md">Medium gap</div>
|
|
622
|
+
<div class="dga-d-flex dga-gap-lg">Large gap</div>
|
|
623
|
+
<div class="dga-d-flex dga-gap-xl">Extra large gap</div>
|
|
624
|
+
|
|
625
|
+
<!-- Gap based on numeric values -->
|
|
626
|
+
<div class="dga-d-flex dga-gap-4">Gap of 16px</div>
|
|
627
|
+
<div class="dga-d-flex dga-gap-8">Gap of 32px</div>
|
|
628
|
+
<div class="dga-d-flex dga-gap-12">Gap of 48px</div>
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### Column Gap (Horizontal)
|
|
632
|
+
|
|
633
|
+
```html
|
|
634
|
+
<div class="dga-d-flex dga-gap-x-md">
|
|
635
|
+
<div>Item 1</div>
|
|
636
|
+
<div>Item 2</div>
|
|
637
|
+
<div>Item 3</div>
|
|
638
|
+
</div>
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
### Row Gap (Vertical)
|
|
642
|
+
|
|
643
|
+
```html
|
|
644
|
+
<div class="dga-d-flex dga-flex-column dga-gap-y-lg">
|
|
645
|
+
<div>Item 1</div>
|
|
646
|
+
<div>Item 2</div>
|
|
647
|
+
<div>Item 3</div>
|
|
648
|
+
</div>
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### Responsive Gaps
|
|
652
|
+
|
|
653
|
+
```html
|
|
654
|
+
<!-- Small gap on mobile, large on desktop -->
|
|
655
|
+
<div class="dga-d-flex dga-gap-sm dga-gap-lg-lg">
|
|
656
|
+
Responsive spacing
|
|
657
|
+
</div>
|
|
658
|
+
|
|
659
|
+
<!-- Different horizontal and vertical gaps -->
|
|
660
|
+
<div class="dga-d-flex dga-gap-x-sm dga-gap-y-md">
|
|
661
|
+
Custom spacing
|
|
662
|
+
</div>
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
---
|
|
666
|
+
|
|
667
|
+
## Display Utilities
|
|
668
|
+
|
|
669
|
+
Control the display property of elements.
|
|
670
|
+
|
|
671
|
+
### Basic Display
|
|
672
|
+
|
|
673
|
+
```html
|
|
674
|
+
<!-- Hide element -->
|
|
675
|
+
<div class="dga-d-none">Hidden</div>
|
|
676
|
+
|
|
677
|
+
<!-- Block display -->
|
|
678
|
+
<div class="dga-d-block">Block element</div>
|
|
679
|
+
|
|
680
|
+
<!-- Inline display -->
|
|
681
|
+
<span class="dga-d-inline">Inline element</span>
|
|
682
|
+
|
|
683
|
+
<!-- Inline-block display -->
|
|
684
|
+
<div class="dga-d-inline-block">Inline-block</div>
|
|
685
|
+
|
|
686
|
+
<!-- Flex display -->
|
|
687
|
+
<div class="dga-d-flex">Flex container</div>
|
|
688
|
+
|
|
689
|
+
<!-- Inline flex -->
|
|
690
|
+
<div class="dga-d-inline-flex">Inline flex</div>
|
|
691
|
+
|
|
692
|
+
<!-- Grid display -->
|
|
693
|
+
<div class="dga-d-grid">Grid container</div>
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
### Responsive Display
|
|
697
|
+
|
|
698
|
+
```html
|
|
699
|
+
<!-- Hide on mobile, show on tablet -->
|
|
700
|
+
<div class="dga-d-none dga-d-md-block">
|
|
701
|
+
Visible on tablet and up
|
|
702
|
+
</div>
|
|
703
|
+
|
|
704
|
+
<!-- Show on mobile, hide on desktop -->
|
|
705
|
+
<div class="dga-d-block dga-d-lg-none">
|
|
706
|
+
Visible only on mobile and tablet
|
|
707
|
+
</div>
|
|
708
|
+
|
|
709
|
+
<!-- Different displays at different sizes -->
|
|
710
|
+
<div class="dga-d-block dga-d-md-flex dga-d-lg-grid">
|
|
711
|
+
Block → Flex → Grid
|
|
712
|
+
</div>
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### Print Display
|
|
716
|
+
|
|
717
|
+
```html
|
|
718
|
+
<!-- Hide when printing -->
|
|
719
|
+
<div class="dga-d-print-none">
|
|
720
|
+
Won't appear in print
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
<!-- Show only when printing -->
|
|
724
|
+
<div class="dga-d-none dga-d-print-block">
|
|
725
|
+
Only visible in print
|
|
726
|
+
</div>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
---
|
|
730
|
+
|
|
731
|
+
## Position Utilities
|
|
732
|
+
|
|
733
|
+
Control element positioning.
|
|
734
|
+
|
|
735
|
+
### Position Values
|
|
736
|
+
|
|
737
|
+
```html
|
|
738
|
+
<!-- Static (default) -->
|
|
739
|
+
<div class="dga-position-static">...</div>
|
|
740
|
+
|
|
741
|
+
<!-- Relative -->
|
|
742
|
+
<div class="dga-position-relative">...</div>
|
|
743
|
+
|
|
744
|
+
<!-- Absolute -->
|
|
745
|
+
<div class="dga-position-absolute">...</div>
|
|
746
|
+
|
|
747
|
+
<!-- Fixed -->
|
|
748
|
+
<div class="dga-position-fixed">...</div>
|
|
749
|
+
|
|
750
|
+
<!-- Sticky -->
|
|
751
|
+
<div class="dga-position-sticky">...</div>
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
### Responsive Position
|
|
755
|
+
|
|
756
|
+
```html
|
|
757
|
+
<!-- Relative on mobile, absolute on desktop -->
|
|
758
|
+
<div class="dga-position-relative dga-position-lg-absolute">
|
|
759
|
+
Responsive positioning
|
|
760
|
+
</div>
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
### Positioning Coordinates
|
|
764
|
+
|
|
765
|
+
```html
|
|
766
|
+
<!-- Top-left corner -->
|
|
767
|
+
<div class="dga-position-absolute dga-top-0 dga-left-0">
|
|
768
|
+
Top-left
|
|
769
|
+
</div>
|
|
770
|
+
|
|
771
|
+
<!-- Center -->
|
|
772
|
+
<div class="dga-position-absolute dga-top-50 dga-left-50">
|
|
773
|
+
50% from top and left
|
|
774
|
+
</div>
|
|
775
|
+
|
|
776
|
+
<!-- Bottom-right corner -->
|
|
777
|
+
<div class="dga-position-absolute dga-bottom-0 dga-right-0">
|
|
778
|
+
Bottom-right
|
|
779
|
+
</div>
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
### Transform Utilities (Centering)
|
|
783
|
+
|
|
784
|
+
```html
|
|
785
|
+
<!-- Perfect center with transform -->
|
|
786
|
+
<div class="dga-position-absolute dga-top-50 dga-left-50 dga-translate-middle">
|
|
787
|
+
Perfectly centered
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
<!-- Center horizontally only -->
|
|
791
|
+
<div class="dga-position-absolute dga-left-50 dga-translate-middle-x">
|
|
792
|
+
Horizontally centered
|
|
793
|
+
</div>
|
|
794
|
+
|
|
795
|
+
<!-- Center vertically only -->
|
|
796
|
+
<div class="dga-position-absolute dga-top-50 dga-translate-middle-y">
|
|
797
|
+
Vertically centered
|
|
798
|
+
</div>
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
### Z-Index Layers
|
|
802
|
+
|
|
803
|
+
```html
|
|
804
|
+
<!-- Predefined z-index layers -->
|
|
805
|
+
<div class="dga-z-dropdown">Dropdown layer (1000)</div>
|
|
806
|
+
<div class="dga-z-sticky">Sticky layer (1020)</div>
|
|
807
|
+
<div class="dga-z-fixed">Fixed layer (1030)</div>
|
|
808
|
+
<div class="dga-z-modal-backdrop">Modal backdrop (1040)</div>
|
|
809
|
+
<div class="dga-z-modal">Modal layer (1050)</div>
|
|
810
|
+
<div class="dga-z-popover">Popover layer (1060)</div>
|
|
811
|
+
<div class="dga-z-tooltip">Tooltip layer (1070)</div>
|
|
812
|
+
<div class="dga-z-toast">Toast layer (1080)</div>
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
817
|
+
## Aspect Ratios
|
|
818
|
+
|
|
819
|
+
Maintain consistent aspect ratios for responsive media.
|
|
820
|
+
|
|
821
|
+
### Available Ratios
|
|
822
|
+
|
|
823
|
+
```html
|
|
824
|
+
<!-- Square (1:1) -->
|
|
825
|
+
<div class="dga-ratio-1x1">
|
|
826
|
+
<img src="image.jpg" alt="Square image">
|
|
827
|
+
</div>
|
|
828
|
+
|
|
829
|
+
<!-- 16:9 (Video) -->
|
|
830
|
+
<div class="dga-ratio-16x9">
|
|
831
|
+
<iframe src="video.mp4"></iframe>
|
|
832
|
+
</div>
|
|
833
|
+
|
|
834
|
+
<!-- 4:3 -->
|
|
835
|
+
<div class="dga-ratio-4x3">
|
|
836
|
+
<img src="photo.jpg" alt="4:3 photo">
|
|
837
|
+
</div>
|
|
838
|
+
|
|
839
|
+
<!-- 3:2 -->
|
|
840
|
+
<div class="dga-ratio-3x2">
|
|
841
|
+
<img src="photo.jpg" alt="3:2 photo">
|
|
842
|
+
</div>
|
|
843
|
+
|
|
844
|
+
<!-- 21:9 (Ultra-wide) -->
|
|
845
|
+
<div class="dga-ratio-21x9">
|
|
846
|
+
<video src="movie.mp4"></video>
|
|
847
|
+
</div>
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### With Embedded Content
|
|
851
|
+
|
|
852
|
+
```html
|
|
853
|
+
<!-- YouTube video -->
|
|
854
|
+
<div class="dga-ratio-16x9">
|
|
855
|
+
<iframe
|
|
856
|
+
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
|
|
857
|
+
frameborder="0"
|
|
858
|
+
allowfullscreen>
|
|
859
|
+
</iframe>
|
|
860
|
+
</div>
|
|
861
|
+
|
|
862
|
+
<!-- Responsive image -->
|
|
863
|
+
<div class="dga-ratio-4x3">
|
|
864
|
+
<img
|
|
865
|
+
src="image.jpg"
|
|
866
|
+
alt="Description"
|
|
867
|
+
style="object-fit: cover;">
|
|
868
|
+
</div>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
---
|
|
872
|
+
|
|
873
|
+
## Configuration
|
|
874
|
+
|
|
875
|
+
### SCSS Variables
|
|
876
|
+
|
|
877
|
+
Customize the grid system by overriding these variables before importing:
|
|
878
|
+
|
|
879
|
+
```scss
|
|
880
|
+
// Grid columns
|
|
881
|
+
$dga-grid-columns: 12 !default;
|
|
882
|
+
|
|
883
|
+
// Breakpoints
|
|
884
|
+
$dga-grid-breakpoints: (
|
|
885
|
+
xs: 0,
|
|
886
|
+
sm: 576px,
|
|
887
|
+
md: 768px,
|
|
888
|
+
lg: 992px,
|
|
889
|
+
xl: 1200px,
|
|
890
|
+
xxl: 1280px
|
|
891
|
+
) !default;
|
|
892
|
+
|
|
893
|
+
// Container max-widths
|
|
894
|
+
$dga-container-max-widths: (
|
|
895
|
+
sm: 540px,
|
|
896
|
+
md: 720px,
|
|
897
|
+
lg: 960px,
|
|
898
|
+
xl: 1140px,
|
|
899
|
+
xxl: 1280px
|
|
900
|
+
) !default;
|
|
901
|
+
|
|
902
|
+
// Gutters
|
|
903
|
+
$dga-grid-gutters: (
|
|
904
|
+
xs: 16px,
|
|
905
|
+
sm: 16px,
|
|
906
|
+
md: 32px,
|
|
907
|
+
lg: 32px,
|
|
908
|
+
xl: 32px,
|
|
909
|
+
xxl: 32px
|
|
910
|
+
) !default;
|
|
911
|
+
|
|
912
|
+
// Enable/disable features
|
|
913
|
+
$dga-enable-container-classes: true !default;
|
|
914
|
+
$dga-enable-row-classes: true !default;
|
|
915
|
+
$dga-enable-col-classes: true !default;
|
|
916
|
+
$dga-enable-responsive-columns: true !default;
|
|
917
|
+
$dga-enable-flex-utilities: true !default;
|
|
918
|
+
$dga-enable-gap-utilities: true !default;
|
|
919
|
+
$dga-enable-display-utilities: true !default;
|
|
920
|
+
$dga-enable-position-utilities: true !default;
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
### Custom Breakpoint Example
|
|
924
|
+
|
|
925
|
+
```scss
|
|
926
|
+
// Add a custom breakpoint
|
|
927
|
+
$dga-grid-breakpoints: dga-add-breakpoint(
|
|
928
|
+
$dga-grid-breakpoints,
|
|
929
|
+
'xxxl',
|
|
930
|
+
1600px
|
|
931
|
+
);
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
### Custom Container Width
|
|
935
|
+
|
|
936
|
+
```scss
|
|
937
|
+
// Add custom container max-width
|
|
938
|
+
$dga-container-max-widths: dga-add-container-width(
|
|
939
|
+
$dga-container-max-widths,
|
|
940
|
+
'xxxl',
|
|
941
|
+
1400px
|
|
942
|
+
);
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
---
|
|
946
|
+
|
|
947
|
+
## Examples
|
|
948
|
+
|
|
949
|
+
### Example 1: Blog Layout
|
|
950
|
+
|
|
951
|
+
```html
|
|
952
|
+
<div class="dga-container">
|
|
953
|
+
<!-- Header -->
|
|
954
|
+
<header class="dga-row dga-align-items-center dga-justify-content-between">
|
|
955
|
+
<div class="dga-col-auto">
|
|
956
|
+
<h1>My Blog</h1>
|
|
957
|
+
</div>
|
|
958
|
+
<nav class="dga-col-auto">
|
|
959
|
+
<ul class="dga-d-flex dga-gap-4">
|
|
960
|
+
<li>Home</li>
|
|
961
|
+
<li>About</li>
|
|
962
|
+
<li>Contact</li>
|
|
963
|
+
</ul>
|
|
964
|
+
</nav>
|
|
965
|
+
</header>
|
|
966
|
+
|
|
967
|
+
<!-- Main content with sidebar -->
|
|
968
|
+
<main class="dga-row dga-gap-8">
|
|
969
|
+
<!-- Sidebar -->
|
|
970
|
+
<aside class="dga-col-12 dga-col-lg-3">
|
|
971
|
+
<h2>Categories</h2>
|
|
972
|
+
<ul>
|
|
973
|
+
<li>Technology</li>
|
|
974
|
+
<li>Design</li>
|
|
975
|
+
<li>Business</li>
|
|
976
|
+
</ul>
|
|
977
|
+
</aside>
|
|
978
|
+
|
|
979
|
+
<!-- Content -->
|
|
980
|
+
<article class="dga-col-12 dga-col-lg-9">
|
|
981
|
+
<h2>Article Title</h2>
|
|
982
|
+
<p>Article content...</p>
|
|
983
|
+
</article>
|
|
984
|
+
</main>
|
|
985
|
+
</div>
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
### Example 2: Card Grid
|
|
989
|
+
|
|
990
|
+
```html
|
|
991
|
+
<div class="dga-container">
|
|
992
|
+
<div class="dga-row dga-gap-6">
|
|
993
|
+
<!-- 1 col mobile, 2 cols tablet, 3 cols desktop -->
|
|
994
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
995
|
+
<div class="dga-ratio-16x9">
|
|
996
|
+
<img src="card1.jpg" alt="Card 1">
|
|
997
|
+
</div>
|
|
998
|
+
<h3>Card Title 1</h3>
|
|
999
|
+
<p>Card description</p>
|
|
1000
|
+
</div>
|
|
1001
|
+
|
|
1002
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1003
|
+
<div class="dga-ratio-16x9">
|
|
1004
|
+
<img src="card2.jpg" alt="Card 2">
|
|
1005
|
+
</div>
|
|
1006
|
+
<h3>Card Title 2</h3>
|
|
1007
|
+
<p>Card description</p>
|
|
1008
|
+
</div>
|
|
1009
|
+
|
|
1010
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1011
|
+
<div class="dga-ratio-16x9">
|
|
1012
|
+
<img src="card3.jpg" alt="Card 3">
|
|
1013
|
+
</div>
|
|
1014
|
+
<h3>Card Title 3</h3>
|
|
1015
|
+
<p>Card description</p>
|
|
1016
|
+
</div>
|
|
1017
|
+
</div>
|
|
1018
|
+
</div>
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
### Example 3: Hero Section
|
|
1022
|
+
|
|
1023
|
+
```html
|
|
1024
|
+
<section class="dga-d-flex dga-align-items-center dga-justify-content-center dga-min-h-screen"
|
|
1025
|
+
style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
|
1026
|
+
<div class="dga-container">
|
|
1027
|
+
<div class="dga-row dga-justify-content-center">
|
|
1028
|
+
<div class="dga-col-12 dga-col-md-8 dga-col-lg-6">
|
|
1029
|
+
<h1 class="dga-d-flex dga-justify-content-center">Welcome</h1>
|
|
1030
|
+
<p class="dga-d-flex dga-justify-content-center">Your tagline here</p>
|
|
1031
|
+
<div class="dga-d-flex dga-justify-content-center dga-gap-4">
|
|
1032
|
+
<button>Get Started</button>
|
|
1033
|
+
<button>Learn More</button>
|
|
1034
|
+
</div>
|
|
1035
|
+
</div>
|
|
1036
|
+
</div>
|
|
1037
|
+
</div>
|
|
1038
|
+
</section>
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
### Example 4: Dashboard Layout
|
|
1042
|
+
|
|
1043
|
+
```html
|
|
1044
|
+
<div class="dga-container-fluid">
|
|
1045
|
+
<div class="dga-row dga-no-gutters">
|
|
1046
|
+
<!-- Sidebar -->
|
|
1047
|
+
<nav class="dga-col-12 dga-col-md-3 dga-col-lg-2 dga-d-flex dga-flex-column">
|
|
1048
|
+
<h2>Dashboard</h2>
|
|
1049
|
+
<ul class="dga-d-flex dga-flex-column dga-gap-2">
|
|
1050
|
+
<li>Overview</li>
|
|
1051
|
+
<li>Analytics</li>
|
|
1052
|
+
<li>Reports</li>
|
|
1053
|
+
<li>Settings</li>
|
|
1054
|
+
</ul>
|
|
1055
|
+
</nav>
|
|
1056
|
+
|
|
1057
|
+
<!-- Main content -->
|
|
1058
|
+
<main class="dga-col-12 dga-col-md-9 dga-col-lg-10">
|
|
1059
|
+
<div class="dga-row dga-gap-6">
|
|
1060
|
+
<!-- Stats cards -->
|
|
1061
|
+
<div class="dga-col-12 dga-col-sm-6 dga-col-xl-3">
|
|
1062
|
+
<div class="card">
|
|
1063
|
+
<h3>Users</h3>
|
|
1064
|
+
<p class="stat">1,234</p>
|
|
1065
|
+
</div>
|
|
1066
|
+
</div>
|
|
1067
|
+
|
|
1068
|
+
<div class="dga-col-12 dga-col-sm-6 dga-col-xl-3">
|
|
1069
|
+
<div class="card">
|
|
1070
|
+
<h3>Revenue</h3>
|
|
1071
|
+
<p class="stat">$45,678</p>
|
|
1072
|
+
</div>
|
|
1073
|
+
</div>
|
|
1074
|
+
|
|
1075
|
+
<div class="dga-col-12 dga-col-sm-6 dga-col-xl-3">
|
|
1076
|
+
<div class="card">
|
|
1077
|
+
<h3>Orders</h3>
|
|
1078
|
+
<p class="stat">567</p>
|
|
1079
|
+
</div>
|
|
1080
|
+
</div>
|
|
1081
|
+
|
|
1082
|
+
<div class="dga-col-12 dga-col-sm-6 dga-col-xl-3">
|
|
1083
|
+
<div class="card">
|
|
1084
|
+
<h3>Growth</h3>
|
|
1085
|
+
<p class="stat">+12%</p>
|
|
1086
|
+
</div>
|
|
1087
|
+
</div>
|
|
1088
|
+
</div>
|
|
1089
|
+
</main>
|
|
1090
|
+
</div>
|
|
1091
|
+
</div>
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
### Example 5: Pricing Table
|
|
1095
|
+
|
|
1096
|
+
```html
|
|
1097
|
+
<div class="dga-container">
|
|
1098
|
+
<div class="dga-row dga-gap-6 dga-justify-content-center">
|
|
1099
|
+
<!-- Pricing card 1 -->
|
|
1100
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1101
|
+
<div class="pricing-card">
|
|
1102
|
+
<h3>Starter</h3>
|
|
1103
|
+
<p class="price">$9/month</p>
|
|
1104
|
+
<ul>
|
|
1105
|
+
<li>Feature 1</li>
|
|
1106
|
+
<li>Feature 2</li>
|
|
1107
|
+
<li>Feature 3</li>
|
|
1108
|
+
</ul>
|
|
1109
|
+
<button>Choose Plan</button>
|
|
1110
|
+
</div>
|
|
1111
|
+
</div>
|
|
1112
|
+
|
|
1113
|
+
<!-- Pricing card 2 (featured) -->
|
|
1114
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1115
|
+
<div class="pricing-card featured">
|
|
1116
|
+
<h3>Professional</h3>
|
|
1117
|
+
<p class="price">$29/month</p>
|
|
1118
|
+
<ul>
|
|
1119
|
+
<li>Everything in Starter</li>
|
|
1120
|
+
<li>Feature 4</li>
|
|
1121
|
+
<li>Feature 5</li>
|
|
1122
|
+
</ul>
|
|
1123
|
+
<button>Choose Plan</button>
|
|
1124
|
+
</div>
|
|
1125
|
+
</div>
|
|
1126
|
+
|
|
1127
|
+
<!-- Pricing card 3 -->
|
|
1128
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1129
|
+
<div class="pricing-card">
|
|
1130
|
+
<h3>Enterprise</h3>
|
|
1131
|
+
<p class="price">$99/month</p>
|
|
1132
|
+
<ul>
|
|
1133
|
+
<li>Everything in Pro</li>
|
|
1134
|
+
<li>Feature 6</li>
|
|
1135
|
+
<li>Feature 7</li>
|
|
1136
|
+
</ul>
|
|
1137
|
+
<button>Choose Plan</button>
|
|
1138
|
+
</div>
|
|
1139
|
+
</div>
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
---
|
|
1145
|
+
|
|
1146
|
+
## Best Practices
|
|
1147
|
+
|
|
1148
|
+
### 1. Always Use Container → Row → Column Structure
|
|
1149
|
+
|
|
1150
|
+
✅ **Correct:**
|
|
1151
|
+
```html
|
|
1152
|
+
<div class="dga-container">
|
|
1153
|
+
<div class="dga-row">
|
|
1154
|
+
<div class="dga-col-6">Content</div>
|
|
1155
|
+
</div>
|
|
1156
|
+
</div>
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
❌ **Incorrect:**
|
|
1160
|
+
```html
|
|
1161
|
+
<div class="dga-container">
|
|
1162
|
+
<div class="dga-col-6">Content</div> <!-- Missing row -->
|
|
1163
|
+
</div>
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
### 2. Mobile-First Responsive Design
|
|
1167
|
+
|
|
1168
|
+
Start with mobile layout, then enhance for larger screens:
|
|
1169
|
+
|
|
1170
|
+
```html
|
|
1171
|
+
<!-- Mobile: stack, Tablet: 2 cols, Desktop: 3 cols -->
|
|
1172
|
+
<div class="dga-col-12 dga-col-md-6 dga-col-lg-4">
|
|
1173
|
+
Content
|
|
1174
|
+
</div>
|
|
1175
|
+
```
|
|
1176
|
+
|
|
1177
|
+
### 3. Use Semantic HTML
|
|
1178
|
+
|
|
1179
|
+
Combine grid classes with semantic HTML elements:
|
|
1180
|
+
|
|
1181
|
+
```html
|
|
1182
|
+
<header class="dga-row">...</header>
|
|
1183
|
+
<main class="dga-row">...</main>
|
|
1184
|
+
<aside class="dga-col-lg-3">...</aside>
|
|
1185
|
+
<article class="dga-col-lg-9">...</article>
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
### 4. Leverage Flexbox Utilities
|
|
1189
|
+
|
|
1190
|
+
Use flexbox utilities for complex alignments:
|
|
1191
|
+
|
|
1192
|
+
```html
|
|
1193
|
+
<div class="dga-row dga-align-items-center dga-justify-content-between">
|
|
1194
|
+
<div class="dga-col-auto">Logo</div>
|
|
1195
|
+
<nav class="dga-col-auto">Menu</nav>
|
|
1196
|
+
</div>
|
|
1197
|
+
```
|
|
1198
|
+
|
|
1199
|
+
### 5. Use Gap Utilities for Modern Spacing
|
|
1200
|
+
|
|
1201
|
+
Prefer gap utilities over margin hacks:
|
|
1202
|
+
|
|
1203
|
+
```html
|
|
1204
|
+
<!-- Modern approach -->
|
|
1205
|
+
<div class="dga-d-flex dga-gap-4">
|
|
1206
|
+
<button>Button 1</button>
|
|
1207
|
+
<button>Button 2</button>
|
|
1208
|
+
</div>
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
### 6. Optimize for Performance
|
|
1212
|
+
|
|
1213
|
+
Only generate utilities you need:
|
|
1214
|
+
|
|
1215
|
+
```scss
|
|
1216
|
+
// Disable unused utilities
|
|
1217
|
+
$dga-enable-position-utilities: false;
|
|
1218
|
+
$dga-enable-aspect-ratio-utilities: false;
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
### 7. Consistent Column Counts
|
|
1222
|
+
|
|
1223
|
+
Ensure rows total 12 columns:
|
|
1224
|
+
|
|
1225
|
+
✅ **Correct:**
|
|
1226
|
+
```html
|
|
1227
|
+
<div class="dga-row">
|
|
1228
|
+
<div class="dga-col-8">Main</div>
|
|
1229
|
+
<div class="dga-col-4">Sidebar</div> <!-- 8 + 4 = 12 -->
|
|
1230
|
+
</div>
|
|
1231
|
+
```
|
|
1232
|
+
|
|
1233
|
+
### 8. Use No-Gutters Sparingly
|
|
1234
|
+
|
|
1235
|
+
Only remove gutters when you have a specific design need:
|
|
1236
|
+
|
|
1237
|
+
```html
|
|
1238
|
+
<!-- Edge-to-edge images -->
|
|
1239
|
+
<div class="dga-row dga-no-gutters">
|
|
1240
|
+
<div class="dga-col-4">
|
|
1241
|
+
<img src="image1.jpg" class="dga-width-full">
|
|
1242
|
+
</div>
|
|
1243
|
+
<!-- More images -->
|
|
1244
|
+
</div>
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
---
|
|
1248
|
+
|
|
1249
|
+
## Troubleshooting
|
|
1250
|
+
|
|
1251
|
+
### Columns Not Sitting Side-by-Side
|
|
1252
|
+
|
|
1253
|
+
**Problem:** Columns stack vertically instead of horizontally.
|
|
1254
|
+
|
|
1255
|
+
**Solution:**
|
|
1256
|
+
1. Ensure columns are inside a `.dga-row`
|
|
1257
|
+
2. Check that column widths don't exceed 12
|
|
1258
|
+
3. Verify you're viewing at the correct breakpoint
|
|
1259
|
+
|
|
1260
|
+
```html
|
|
1261
|
+
<!-- Correct -->
|
|
1262
|
+
<div class="dga-row">
|
|
1263
|
+
<div class="dga-col-md-6">Column 1</div>
|
|
1264
|
+
<div class="dga-col-md-6">Column 2</div>
|
|
1265
|
+
</div>
|
|
1266
|
+
```
|
|
1267
|
+
|
|
1268
|
+
### Columns Have No Spacing
|
|
1269
|
+
|
|
1270
|
+
**Problem:** Columns touch each other with no gaps.
|
|
1271
|
+
|
|
1272
|
+
**Solution:**
|
|
1273
|
+
1. Remove `.dga-no-gutters` if present
|
|
1274
|
+
2. Ensure columns have padding (check compiled CSS)
|
|
1275
|
+
3. Verify row has negative margins
|
|
1276
|
+
|
|
1277
|
+
### Content Overflowing Container
|
|
1278
|
+
|
|
1279
|
+
**Problem:** Content extends beyond container bounds.
|
|
1280
|
+
|
|
1281
|
+
**Solution:**
|
|
1282
|
+
1. Use `.dga-container` instead of `.dga-container-fluid`
|
|
1283
|
+
2. Check for `width` or `min-width` on children
|
|
1284
|
+
3. Add `overflow: hidden` if needed
|
|
1285
|
+
|
|
1286
|
+
### Responsive Classes Not Working
|
|
1287
|
+
|
|
1288
|
+
**Problem:** Responsive breakpoints not triggering.
|
|
1289
|
+
|
|
1290
|
+
**Solution:**
|
|
1291
|
+
1. Verify `<meta name="viewport">` tag in HTML:
|
|
1292
|
+
```html
|
|
1293
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1294
|
+
```
|
|
1295
|
+
2. Check browser viewport width
|
|
1296
|
+
3. Inspect compiled CSS for media queries
|
|
1297
|
+
|
|
1298
|
+
### Flexbox Alignment Not Working
|
|
1299
|
+
|
|
1300
|
+
**Problem:** `align-items` or `justify-content` has no effect.
|
|
1301
|
+
|
|
1302
|
+
**Solution:**
|
|
1303
|
+
1. Ensure parent has `.dga-d-flex`
|
|
1304
|
+
2. Check for `flex-direction` conflicts
|
|
1305
|
+
3. Verify sufficient height for vertical alignment — use `dga-min-h-screen` or `dga-h-full` on the flex container (see [Width & Height](./width-height.md))
|
|
1306
|
+
|
|
1307
|
+
### Grid Not Compiling
|
|
1308
|
+
|
|
1309
|
+
**Problem:** SCSS compilation errors.
|
|
1310
|
+
|
|
1311
|
+
**Solution:**
|
|
1312
|
+
1. Ensure variables are imported before utilities
|
|
1313
|
+
2. Check for missing functions (percentage, map-get)
|
|
1314
|
+
3. Verify SCSS syntax is correct
|
|
1315
|
+
|
|
1316
|
+
### Performance Issues
|
|
1317
|
+
|
|
1318
|
+
**Problem:** Large CSS file size.
|
|
1319
|
+
|
|
1320
|
+
**Solution:**
|
|
1321
|
+
1. Disable unused utilities in variables
|
|
1322
|
+
2. Use selective generation:
|
|
1323
|
+
```scss
|
|
1324
|
+
@include generate-responsive-columns();
|
|
1325
|
+
// Don't generate all utilities
|
|
1326
|
+
```
|
|
1327
|
+
3. Purge unused CSS in production
|
|
1328
|
+
|
|
1329
|
+
---
|
|
1330
|
+
|
|
1331
|
+
## Browser Support
|
|
1332
|
+
|
|
1333
|
+
The DGA Grid System supports:
|
|
1334
|
+
|
|
1335
|
+
- ✅ Chrome (last 2 versions)
|
|
1336
|
+
- ✅ Firefox (last 2 versions)
|
|
1337
|
+
- ✅ Safari (last 2 versions)
|
|
1338
|
+
- ✅ Edge (last 2 versions)
|
|
1339
|
+
- ⚠️ IE 11 (partial support - no gap utilities)
|
|
1340
|
+
|
|
1341
|
+
### Fallbacks for Older Browsers
|
|
1342
|
+
|
|
1343
|
+
For IE 11 support, use margin-based spacing instead of gap:
|
|
1344
|
+
|
|
1345
|
+
```html
|
|
1346
|
+
<!-- Modern browsers -->
|
|
1347
|
+
<div class="dga-d-flex dga-gap-4">
|
|
1348
|
+
<button>Button</button>
|
|
1349
|
+
</div>
|
|
1350
|
+
|
|
1351
|
+
<!-- IE 11 fallback -->
|
|
1352
|
+
<div class="dga-d-flex">
|
|
1353
|
+
<button style="margin-right: 16px;">Button</button>
|
|
1354
|
+
</div>
|
|
1355
|
+
```
|
|
1356
|
+
|
|
1357
|
+
---
|
|
1358
|
+
|
|
1359
|
+
## Migration Guide
|
|
1360
|
+
|
|
1361
|
+
### From Bootstrap to DGA Grid
|
|
1362
|
+
|
|
1363
|
+
| Bootstrap | DGA Grid | Notes |
|
|
1364
|
+
|-----------|----------|-------|
|
|
1365
|
+
| `.container` | `.dga-container` | Same behavior |
|
|
1366
|
+
| `.row` | `.dga-row` | Same behavior |
|
|
1367
|
+
| `.col-6` | `.dga-col-6` | Same behavior |
|
|
1368
|
+
| `.col-md-4` | `.dga-col-md-4` | Same behavior |
|
|
1369
|
+
| `.d-flex` | `.dga-d-flex` | Same behavior |
|
|
1370
|
+
| `.flex-column` | `.dga-flex-col` or `.dga-flex-column` | Both column class names work |
|
|
1371
|
+
| `.w-100` | `.dga-w-full` or `.dga-w-100` | Same behavior |
|
|
1372
|
+
| `.h-100` | `.dga-h-full` or `.dga-h-100` | Same behavior |
|
|
1373
|
+
| `.min-vh-100` | `.dga-min-h-screen` | Viewport height |
|
|
1374
|
+
| `.justify-content-center` | `.dga-justify-content-center` | Same behavior |
|
|
1375
|
+
| `.g-3` | `.dga-gap-3` | Uses different scale |
|
|
1376
|
+
| `.offset-2` | `.dga-offset-2` | Same behavior |
|
|
1377
|
+
|
|
1378
|
+
### Key Differences
|
|
1379
|
+
|
|
1380
|
+
1. **Prefix:** All classes use `dga-` prefix
|
|
1381
|
+
2. **Gap scale:** Uses DGA spacing system (4px base)
|
|
1382
|
+
3. **Gutters:** 16px mobile, 32px desktop (vs Bootstrap's 24px)
|
|
1383
|
+
4. **Breakpoints:** xxl at 1280px (vs Bootstrap's 1400px)
|
|
1384
|
+
|
|
1385
|
+
---
|
|
1386
|
+
|
|
1387
|
+
## Resources
|
|
1388
|
+
|
|
1389
|
+
- **Width & Height:** [width-height.md](./width-height.md)
|
|
1390
|
+
- **npm Usage:** [README.md](../README.md)
|
|
1391
|
+
- **Source Code:** [GitHub Repository](https://github.com/waaelg/personal_fe_dga-sass)
|
|
1392
|
+
- **Design System:** [DGA Design Guidelines](#)
|
|
1393
|
+
- **Support:** [Issues & Questions](#)
|
|
1394
|
+
- **Changelog:** [Version History](#)
|
|
1395
|
+
|
|
1396
|
+
---
|
|
1397
|
+
|
|
1398
|
+
## License
|
|
1399
|
+
|
|
1400
|
+
© 2024 DGA Design System. All rights reserved.
|
|
1401
|
+
|
|
1402
|
+
---
|
|
1403
|
+
|
|
1404
|
+
**Version:** 1.1.0
|
|
1405
|
+
**Last Updated:** June 2025
|
|
1406
|
+
**Maintained by:** DGA Design Team
|