@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,1166 @@
|
|
|
1
|
+
# Border Radius
|
|
2
|
+
|
|
3
|
+
Radius utilities and component rounding patterns.
|
|
4
|
+
|
|
5
|
+
**Source:** `src/styles/utilities/radius.scss`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick start (npm)
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import '@waaelg/dga-design-on-sass/style.css'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<button class="dga-btn dga-btn-primary dga-rounded-md">Button</button>
|
|
17
|
+
<div class="dga-card dga-rounded-lg">Card</div>
|
|
18
|
+
<img class="dga-rounded-full" src="avatar.jpg" alt="" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Class | Radius |
|
|
22
|
+
|-------|--------|
|
|
23
|
+
| `dga-rounded-sm` | 4px |
|
|
24
|
+
| `dga-rounded-md` | 8px (default for inputs/buttons) |
|
|
25
|
+
| `dga-rounded-lg` | 16px (cards) |
|
|
26
|
+
| `dga-rounded-full` | Pill / circle |
|
|
27
|
+
|
|
28
|
+
SCSS variables and mixins: [below](#scss-variables) (repo contributors).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Table of Contents
|
|
33
|
+
|
|
34
|
+
1. [Overview](#overview)
|
|
35
|
+
2. [Radius Scale](#radius-scale)
|
|
36
|
+
3. [Basic Utilities](#basic-utilities)
|
|
37
|
+
4. [Side Utilities](#side-utilities)
|
|
38
|
+
5. [Corner Utilities](#corner-utilities)
|
|
39
|
+
6. [Component Patterns](#component-patterns)
|
|
40
|
+
7. [SCSS Variables](#scss-variables)
|
|
41
|
+
8. [SCSS Mixins](#scss-mixins)
|
|
42
|
+
9. [Usage Examples](#usage-examples)
|
|
43
|
+
10. [Best Practices](#best-practices)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
The DGA Border Radius system provides a consistent, scalable approach to rounded corners across your application. It includes:
|
|
50
|
+
|
|
51
|
+
- **7 base radius sizes** from sharp to fully rounded
|
|
52
|
+
- **3 extended sizes** for larger components
|
|
53
|
+
- **Directional utilities** for specific corners
|
|
54
|
+
- **Component-specific variables** for common UI patterns
|
|
55
|
+
- **SCSS mixins** for custom styling
|
|
56
|
+
|
|
57
|
+
### Philosophy
|
|
58
|
+
|
|
59
|
+
Border radius creates visual hierarchy and improves user experience by:
|
|
60
|
+
- Softening harsh edges for a friendlier interface
|
|
61
|
+
- Drawing attention to interactive elements
|
|
62
|
+
- Creating visual separation between components
|
|
63
|
+
- Establishing a consistent visual language
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Radius Scale
|
|
68
|
+
|
|
69
|
+
### Base Scale
|
|
70
|
+
|
|
71
|
+
| Size | Rem Value | Pixel Value | Use Case |
|
|
72
|
+
|------|-----------|-------------|----------|
|
|
73
|
+
| `none` | `0` | `0px` | Sharp corners, technical UIs |
|
|
74
|
+
| `xs` | `0.125rem` | `2px` | Subtle rounding, small elements |
|
|
75
|
+
| `sm` | `0.25rem` | `4px` | Tags, small badges |
|
|
76
|
+
| `md` | `0.5rem` | `8px` | **Default** - Buttons, inputs |
|
|
77
|
+
| `lg` | `1rem` | `16px` | Cards, panels |
|
|
78
|
+
| `xl` | `1.5rem` | `24px` | Modals, large cards |
|
|
79
|
+
| `full` | `9999px` | `Infinite` | Circles, pills |
|
|
80
|
+
|
|
81
|
+
### Extended Scale
|
|
82
|
+
|
|
83
|
+
| Size | Rem Value | Pixel Value | Use Case |
|
|
84
|
+
|------|-----------|-------------|----------|
|
|
85
|
+
| `2xl` | `2rem` | `32px` | Large modals |
|
|
86
|
+
| `3xl` | `2.5rem` | `40px` | Hero sections |
|
|
87
|
+
| `4xl` | `3rem` | `48px` | Extra large components |
|
|
88
|
+
|
|
89
|
+
### Visual Reference
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
none ┌────────┐ No rounding
|
|
93
|
+
│ │
|
|
94
|
+
└────────┘
|
|
95
|
+
|
|
96
|
+
xs ┌────────┐ Very subtle (2px)
|
|
97
|
+
│ │
|
|
98
|
+
└────────┘
|
|
99
|
+
|
|
100
|
+
sm ╭────────╮ Subtle (4px)
|
|
101
|
+
│ │
|
|
102
|
+
╰────────╯
|
|
103
|
+
|
|
104
|
+
md ╭────────╮ Standard (8px) ⭐
|
|
105
|
+
│ │
|
|
106
|
+
╰────────╯
|
|
107
|
+
|
|
108
|
+
lg ╭────────╮ Prominent (16px)
|
|
109
|
+
│ │
|
|
110
|
+
╰────────╯
|
|
111
|
+
|
|
112
|
+
xl ╭────────╮ Very round (24px)
|
|
113
|
+
│ │
|
|
114
|
+
╰────────╯
|
|
115
|
+
|
|
116
|
+
full ╭────────╮ Pill/Circle (9999px)
|
|
117
|
+
│ │
|
|
118
|
+
╰────────╯
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Basic Utilities
|
|
124
|
+
|
|
125
|
+
### All Corners
|
|
126
|
+
|
|
127
|
+
Apply the same radius to all four corners.
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<!-- No rounding -->
|
|
131
|
+
<div class="dga-rounded-none">Sharp corners</div>
|
|
132
|
+
|
|
133
|
+
<!-- Extra small (2px) -->
|
|
134
|
+
<div class="dga-rounded-xs">Subtle rounding</div>
|
|
135
|
+
|
|
136
|
+
<!-- Small (4px) -->
|
|
137
|
+
<div class="dga-rounded-sm">Small rounding</div>
|
|
138
|
+
|
|
139
|
+
<!-- Medium (8px) - Default ⭐ -->
|
|
140
|
+
<div class="dga-rounded-md">Standard rounding</div>
|
|
141
|
+
|
|
142
|
+
<!-- Large (16px) -->
|
|
143
|
+
<div class="dga-rounded-lg">Large rounding</div>
|
|
144
|
+
|
|
145
|
+
<!-- Extra large (24px) -->
|
|
146
|
+
<div class="dga-rounded-xl">Extra large rounding</div>
|
|
147
|
+
|
|
148
|
+
<!-- Full (pill/circle) -->
|
|
149
|
+
<div class="dga-rounded-full">Fully rounded</div>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Pattern:** `.dga-rounded-{size}`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Side Utilities
|
|
157
|
+
|
|
158
|
+
### Top Corners
|
|
159
|
+
|
|
160
|
+
Round only the top-left and top-right corners.
|
|
161
|
+
|
|
162
|
+
```html
|
|
163
|
+
<div class="dga-rounded-t-none">Sharp top</div>
|
|
164
|
+
<div class="dga-rounded-t-sm">Small rounded top</div>
|
|
165
|
+
<div class="dga-rounded-t-md">Medium rounded top</div>
|
|
166
|
+
<div class="dga-rounded-t-lg">Large rounded top</div>
|
|
167
|
+
<div class="dga-rounded-t-xl">Extra large rounded top</div>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Pattern:** `.dga-rounded-t-{size}`
|
|
171
|
+
|
|
172
|
+
**Use Cases:**
|
|
173
|
+
- Card headers
|
|
174
|
+
- Modal titles
|
|
175
|
+
- Dropdown tops
|
|
176
|
+
- Accordion items
|
|
177
|
+
|
|
178
|
+
### Bottom Corners
|
|
179
|
+
|
|
180
|
+
Round only the bottom-left and bottom-right corners.
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<div class="dga-rounded-b-none">Sharp bottom</div>
|
|
184
|
+
<div class="dga-rounded-b-sm">Small rounded bottom</div>
|
|
185
|
+
<div class="dga-rounded-b-md">Medium rounded bottom</div>
|
|
186
|
+
<div class="dga-rounded-b-lg">Large rounded bottom</div>
|
|
187
|
+
<div class="dga-rounded-b-xl">Extra large rounded bottom</div>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Pattern:** `.dga-rounded-b-{size}`
|
|
191
|
+
|
|
192
|
+
**Use Cases:**
|
|
193
|
+
- Card footers
|
|
194
|
+
- Dropdown bottoms
|
|
195
|
+
- Bottom sheets
|
|
196
|
+
- Toast notifications
|
|
197
|
+
|
|
198
|
+
### Left Corners
|
|
199
|
+
|
|
200
|
+
Round only the top-left and bottom-left corners.
|
|
201
|
+
|
|
202
|
+
```html
|
|
203
|
+
<div class="dga-rounded-l-none">Sharp left</div>
|
|
204
|
+
<div class="dga-rounded-l-sm">Small rounded left</div>
|
|
205
|
+
<div class="dga-rounded-l-md">Medium rounded left</div>
|
|
206
|
+
<div class="dga-rounded-l-lg">Large rounded left</div>
|
|
207
|
+
<div class="dga-rounded-l-xl">Extra large rounded left</div>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Pattern:** `.dga-rounded-l-{size}`
|
|
211
|
+
|
|
212
|
+
**Use Cases:**
|
|
213
|
+
- Side panels (RTL layouts)
|
|
214
|
+
- Tab groups (left side)
|
|
215
|
+
- Split buttons (left part)
|
|
216
|
+
|
|
217
|
+
### Right Corners
|
|
218
|
+
|
|
219
|
+
Round only the top-right and bottom-right corners.
|
|
220
|
+
|
|
221
|
+
```html
|
|
222
|
+
<div class="dga-rounded-r-none">Sharp right</div>
|
|
223
|
+
<div class="dga-rounded-r-sm">Small rounded right</div>
|
|
224
|
+
<div class="dga-rounded-r-md">Medium rounded right</div>
|
|
225
|
+
<div class="dga-rounded-r-lg">Large rounded right</div>
|
|
226
|
+
<div class="dga-rounded-r-xl">Extra large rounded right</div>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Pattern:** `.dga-rounded-r-{size}`
|
|
230
|
+
|
|
231
|
+
**Use Cases:**
|
|
232
|
+
- Side panels (LTR layouts)
|
|
233
|
+
- Tab groups (right side)
|
|
234
|
+
- Split buttons (right part)
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Corner Utilities
|
|
239
|
+
|
|
240
|
+
### Individual Corners
|
|
241
|
+
|
|
242
|
+
Apply radius to a single corner.
|
|
243
|
+
|
|
244
|
+
#### Top-Left
|
|
245
|
+
|
|
246
|
+
```html
|
|
247
|
+
<div class="dga-rounded-tl-none">Sharp top-left</div>
|
|
248
|
+
<div class="dga-rounded-tl-md">Rounded top-left</div>
|
|
249
|
+
<div class="dga-rounded-tl-lg">Large top-left</div>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Pattern:** `.dga-rounded-tl-{size}`
|
|
253
|
+
|
|
254
|
+
#### Top-Right
|
|
255
|
+
|
|
256
|
+
```html
|
|
257
|
+
<div class="dga-rounded-tr-none">Sharp top-right</div>
|
|
258
|
+
<div class="dga-rounded-tr-md">Rounded top-right</div>
|
|
259
|
+
<div class="dga-rounded-tr-lg">Large top-right</div>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Pattern:** `.dga-rounded-tr-{size}`
|
|
263
|
+
|
|
264
|
+
#### Bottom-Left
|
|
265
|
+
|
|
266
|
+
```html
|
|
267
|
+
<div class="dga-rounded-bl-none">Sharp bottom-left</div>
|
|
268
|
+
<div class="dga-rounded-bl-md">Rounded bottom-left</div>
|
|
269
|
+
<div class="dga-rounded-bl-lg">Large bottom-left</div>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Pattern:** `.dga-rounded-bl-{size}`
|
|
273
|
+
|
|
274
|
+
#### Bottom-Right
|
|
275
|
+
|
|
276
|
+
```html
|
|
277
|
+
<div class="dga-rounded-br-none">Sharp bottom-right</div>
|
|
278
|
+
<div class="dga-rounded-br-md">Rounded bottom-right</div>
|
|
279
|
+
<div class="dga-rounded-br-lg">Large bottom-right</div>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Pattern:** `.dga-rounded-br-{size}`
|
|
283
|
+
|
|
284
|
+
### Diagonal Corners
|
|
285
|
+
|
|
286
|
+
Create unique designs by rounding opposite corners.
|
|
287
|
+
|
|
288
|
+
```html
|
|
289
|
+
<!-- Top-left and bottom-right -->
|
|
290
|
+
<div class="dga-rounded-tl-lg dga-rounded-br-lg">
|
|
291
|
+
Diagonal rounded corners
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
<!-- Top-right and bottom-left -->
|
|
295
|
+
<div class="dga-rounded-tr-lg dga-rounded-bl-lg">
|
|
296
|
+
Opposite diagonal
|
|
297
|
+
</div>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Component Patterns
|
|
303
|
+
|
|
304
|
+
### Buttons
|
|
305
|
+
|
|
306
|
+
```html
|
|
307
|
+
<!-- Default button (8px) -->
|
|
308
|
+
<button class="dga-rounded-md">Standard Button</button>
|
|
309
|
+
|
|
310
|
+
<!-- Small button (4px) -->
|
|
311
|
+
<button class="dga-rounded-sm">Small Button</button>
|
|
312
|
+
|
|
313
|
+
<!-- Large button (16px) -->
|
|
314
|
+
<button class="dga-rounded-lg">Large Button</button>
|
|
315
|
+
|
|
316
|
+
<!-- Pill button -->
|
|
317
|
+
<button class="dga-rounded-full">Pill Button</button>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**SCSS Variables:**
|
|
321
|
+
```scss
|
|
322
|
+
$dga-radius-button: 8px; // Default
|
|
323
|
+
$dga-radius-button-sm: 4px; // Small
|
|
324
|
+
$dga-radius-button-lg: 16px; // Large
|
|
325
|
+
$dga-radius-button-pill: 9999px; // Pill
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### Cards
|
|
331
|
+
|
|
332
|
+
```html
|
|
333
|
+
<!-- Default card (16px) -->
|
|
334
|
+
<div class="dga-rounded-lg dga-border">
|
|
335
|
+
<div class="card-header">Header</div>
|
|
336
|
+
<div class="card-body">Content</div>
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
<!-- Small card (8px) -->
|
|
340
|
+
<div class="dga-rounded-md dga-border">
|
|
341
|
+
Compact card
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<!-- Large card (24px) -->
|
|
345
|
+
<div class="dga-rounded-xl dga-border">
|
|
346
|
+
Premium card
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<!-- Card with header (rounded top only) -->
|
|
350
|
+
<div class="dga-border">
|
|
351
|
+
<div class="dga-bg-gray-100 dga-rounded-t-lg">
|
|
352
|
+
Header
|
|
353
|
+
</div>
|
|
354
|
+
<div>
|
|
355
|
+
Body content
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**SCSS Variables:**
|
|
361
|
+
```scss
|
|
362
|
+
$dga-radius-card: 16px; // Default
|
|
363
|
+
$dga-radius-card-sm: 8px; // Small
|
|
364
|
+
$dga-radius-card-lg: 24px; // Large
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Form Inputs
|
|
370
|
+
|
|
371
|
+
```html
|
|
372
|
+
<!-- Default input (8px) -->
|
|
373
|
+
<input type="text" class="dga-rounded-md" placeholder="Email">
|
|
374
|
+
|
|
375
|
+
<!-- Small input (4px) -->
|
|
376
|
+
<input type="text" class="dga-rounded-sm dga-input-sm" placeholder="Search">
|
|
377
|
+
|
|
378
|
+
<!-- Large input (16px) -->
|
|
379
|
+
<input type="text" class="dga-rounded-lg dga-input-lg" placeholder="Search">
|
|
380
|
+
|
|
381
|
+
<!-- Input group -->
|
|
382
|
+
<div style="display: flex;">
|
|
383
|
+
<input type="text" class="dga-rounded-l-md" style="border-right: none;">
|
|
384
|
+
<button class="dga-rounded-r-md">Submit</button>
|
|
385
|
+
</div>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**SCSS Variables:**
|
|
389
|
+
```scss
|
|
390
|
+
$dga-radius-input: 8px; // Default
|
|
391
|
+
$dga-radius-input-sm: 4px; // Small
|
|
392
|
+
$dga-radius-input-lg: 16px; // Large
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### Modals & Dialogs
|
|
398
|
+
|
|
399
|
+
```html
|
|
400
|
+
<!-- Modal (24px) -->
|
|
401
|
+
<div class="dga-rounded-xl dga-bg-white" style="width: 500px;">
|
|
402
|
+
<div class="modal-header">
|
|
403
|
+
<h2>Modal Title</h2>
|
|
404
|
+
</div>
|
|
405
|
+
<div class="modal-body">
|
|
406
|
+
Modal content
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
<!-- Dialog (16px) -->
|
|
411
|
+
<div class="dga-rounded-lg dga-bg-white" style="width: 400px;">
|
|
412
|
+
<p>Are you sure you want to continue?</p>
|
|
413
|
+
<div>
|
|
414
|
+
<button class="dga-rounded-md">Cancel</button>
|
|
415
|
+
<button class="dga-rounded-md">Confirm</button>
|
|
416
|
+
</div>
|
|
417
|
+
</div>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**SCSS Variables:**
|
|
421
|
+
```scss
|
|
422
|
+
$dga-radius-modal: 24px; // Modals
|
|
423
|
+
$dga-radius-dialog: 16px; // Dialogs
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### Badges & Tags
|
|
429
|
+
|
|
430
|
+
```html
|
|
431
|
+
<!-- Badge (pill shape) -->
|
|
432
|
+
<span class="dga-rounded-full dga-bg-primary-100 dga-text-primary-700"
|
|
433
|
+
style="padding: 4px 12px; font-size: 14px;">
|
|
434
|
+
Active
|
|
435
|
+
</span>
|
|
436
|
+
|
|
437
|
+
<!-- Tag (4px) -->
|
|
438
|
+
<span class="dga-rounded-sm dga-bg-gray-200 dga-text-gray-700"
|
|
439
|
+
style="padding: 2px 8px; font-size: 12px;">
|
|
440
|
+
Technology
|
|
441
|
+
</span>
|
|
442
|
+
|
|
443
|
+
<!-- Status badge -->
|
|
444
|
+
<span class="dga-rounded-full dga-bg-success-500"
|
|
445
|
+
style="width: 8px; height: 8px; display: inline-block;">
|
|
446
|
+
</span>
|
|
447
|
+
Online
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**SCSS Variables:**
|
|
451
|
+
```scss
|
|
452
|
+
$dga-radius-badge: 9999px; // Pill
|
|
453
|
+
$dga-radius-tag: 4px; // Small
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
### Avatars
|
|
459
|
+
|
|
460
|
+
```html
|
|
461
|
+
<!-- Rounded avatar (16px) -->
|
|
462
|
+
<img src="avatar.jpg" class="dga-rounded-lg"
|
|
463
|
+
style="width: 48px; height: 48px;">
|
|
464
|
+
|
|
465
|
+
<!-- Circular avatar -->
|
|
466
|
+
<img src="avatar.jpg" class="dga-rounded-full"
|
|
467
|
+
style="width: 48px; height: 48px;">
|
|
468
|
+
|
|
469
|
+
<!-- Avatar with status -->
|
|
470
|
+
<div style="position: relative; display: inline-block;">
|
|
471
|
+
<img src="avatar.jpg" class="dga-rounded-full"
|
|
472
|
+
style="width: 48px; height: 48px;">
|
|
473
|
+
<span class="dga-rounded-full dga-bg-success-500"
|
|
474
|
+
style="width: 12px; height: 12px; position: absolute; bottom: 0; right: 0; border: 2px solid white;">
|
|
475
|
+
</span>
|
|
476
|
+
</div>
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**SCSS Variables:**
|
|
480
|
+
```scss
|
|
481
|
+
$dga-radius-avatar-rounded: 16px; // Rounded
|
|
482
|
+
$dga-radius-avatar-circle: 9999px; // Circle
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### Dropdowns & Selects
|
|
488
|
+
|
|
489
|
+
```html
|
|
490
|
+
<!-- Dropdown (8px) -->
|
|
491
|
+
<div class="dga-rounded-md dga-border dga-bg-white"
|
|
492
|
+
style="min-width: 200px;">
|
|
493
|
+
<div style="padding: 8px 12px;">Option 1</div>
|
|
494
|
+
<div style="padding: 8px 12px;">Option 2</div>
|
|
495
|
+
<div style="padding: 8px 12px;">Option 3</div>
|
|
496
|
+
</div>
|
|
497
|
+
|
|
498
|
+
<!-- Select input (8px) -->
|
|
499
|
+
<select class="dga-rounded-md dga-border">
|
|
500
|
+
<option>Select option</option>
|
|
501
|
+
<option>Option 1</option>
|
|
502
|
+
<option>Option 2</option>
|
|
503
|
+
</select>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**SCSS Variables:**
|
|
507
|
+
```scss
|
|
508
|
+
$dga-radius-dropdown: 8px; // Dropdowns
|
|
509
|
+
$dga-radius-select: 8px; // Selects
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
### Tooltips
|
|
515
|
+
|
|
516
|
+
```html
|
|
517
|
+
<!-- Tooltip (4px) -->
|
|
518
|
+
<div class="dga-rounded-sm dga-bg-gray-900 dga-text-white"
|
|
519
|
+
style="padding: 6px 12px; font-size: 14px;">
|
|
520
|
+
This is a tooltip
|
|
521
|
+
</div>
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**SCSS Variables:**
|
|
525
|
+
```scss
|
|
526
|
+
$dga-radius-tooltip: 4px;
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
### Images & Thumbnails
|
|
532
|
+
|
|
533
|
+
```html
|
|
534
|
+
<!-- Rounded image (16px) -->
|
|
535
|
+
<img src="photo.jpg" class="dga-rounded-lg"
|
|
536
|
+
style="width: 300px; height: 200px; object-fit: cover;">
|
|
537
|
+
|
|
538
|
+
<!-- Thumbnail (8px) -->
|
|
539
|
+
<img src="thumb.jpg" class="dga-rounded-md"
|
|
540
|
+
style="width: 100px; height: 100px; object-fit: cover;">
|
|
541
|
+
|
|
542
|
+
<!-- Circular profile image -->
|
|
543
|
+
<img src="profile.jpg" class="dga-rounded-full"
|
|
544
|
+
style="width: 120px; height: 120px; object-fit: cover;">
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
**SCSS Variables:**
|
|
548
|
+
```scss
|
|
549
|
+
$dga-radius-image: 16px; // Images
|
|
550
|
+
$dga-radius-thumbnail: 8px; // Thumbnails
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
## SCSS Variables
|
|
556
|
+
|
|
557
|
+
### Direct Access
|
|
558
|
+
|
|
559
|
+
Use radius variables directly in your SCSS:
|
|
560
|
+
|
|
561
|
+
```scss
|
|
562
|
+
// Import variables
|
|
563
|
+
@import 'variables/radius';
|
|
564
|
+
|
|
565
|
+
// Apply to elements
|
|
566
|
+
.my-button {
|
|
567
|
+
border-radius: $dga-radius-md; // 8px
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.my-card {
|
|
571
|
+
border-radius: $dga-radius-lg; // 16px
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.my-badge {
|
|
575
|
+
border-radius: $dga-radius-full; // 9999px
|
|
576
|
+
}
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
### Available Variables
|
|
580
|
+
|
|
581
|
+
#### Base Sizes
|
|
582
|
+
|
|
583
|
+
```scss
|
|
584
|
+
$dga-radius-none: 0;
|
|
585
|
+
$dga-radius-xs: 0.125rem; // 2px
|
|
586
|
+
$dga-radius-sm: 0.25rem; // 4px
|
|
587
|
+
$dga-radius-md: 0.5rem; // 8px
|
|
588
|
+
$dga-radius-lg: 1rem; // 16px
|
|
589
|
+
$dga-radius-xl: 1.5rem; // 24px
|
|
590
|
+
$dga-radius-full: 9999px; // Fully rounded
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
#### Extended Sizes
|
|
594
|
+
|
|
595
|
+
```scss
|
|
596
|
+
$dga-radius-2xl: 2rem; // 32px
|
|
597
|
+
$dga-radius-3xl: 2.5rem; // 40px
|
|
598
|
+
$dga-radius-4xl: 3rem; // 48px
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
#### Component-Specific
|
|
602
|
+
|
|
603
|
+
```scss
|
|
604
|
+
// Buttons
|
|
605
|
+
$dga-radius-button: $dga-radius-md;
|
|
606
|
+
$dga-radius-button-sm: $dga-radius-sm;
|
|
607
|
+
$dga-radius-button-lg: $dga-radius-lg;
|
|
608
|
+
$dga-radius-button-pill: $dga-radius-full;
|
|
609
|
+
|
|
610
|
+
// Cards
|
|
611
|
+
$dga-radius-card: $dga-radius-lg;
|
|
612
|
+
$dga-radius-card-sm: $dga-radius-md;
|
|
613
|
+
$dga-radius-card-lg: $dga-radius-xl;
|
|
614
|
+
|
|
615
|
+
// Inputs
|
|
616
|
+
$dga-radius-input: $dga-radius-md;
|
|
617
|
+
$dga-radius-input-sm: $dga-radius-sm;
|
|
618
|
+
$dga-radius-input-lg: $dga-radius-lg;
|
|
619
|
+
|
|
620
|
+
// Modals
|
|
621
|
+
$dga-radius-modal: $dga-radius-xl;
|
|
622
|
+
$dga-radius-dialog: $dga-radius-lg;
|
|
623
|
+
|
|
624
|
+
// Badges & Tags
|
|
625
|
+
$dga-radius-badge: $dga-radius-full;
|
|
626
|
+
$dga-radius-tag: $dga-radius-sm;
|
|
627
|
+
|
|
628
|
+
// Avatars
|
|
629
|
+
$dga-radius-avatar-rounded: $dga-radius-lg;
|
|
630
|
+
$dga-radius-avatar-circle: $dga-radius-full;
|
|
631
|
+
|
|
632
|
+
// Dropdowns
|
|
633
|
+
$dga-radius-dropdown: $dga-radius-md;
|
|
634
|
+
$dga-radius-select: $dga-radius-md;
|
|
635
|
+
|
|
636
|
+
// Tooltips
|
|
637
|
+
$dga-radius-tooltip: $dga-radius-sm;
|
|
638
|
+
|
|
639
|
+
// Images
|
|
640
|
+
$dga-radius-image: $dga-radius-lg;
|
|
641
|
+
$dga-radius-thumbnail: $dga-radius-md;
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
### Helper Function
|
|
645
|
+
|
|
646
|
+
```scss
|
|
647
|
+
// Access radius from map
|
|
648
|
+
@function radius($key) {
|
|
649
|
+
@return map-get($dga-radius, $key);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// Usage
|
|
653
|
+
.my-element {
|
|
654
|
+
border-radius: radius("lg"); // 16px
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
## SCSS Mixins
|
|
661
|
+
|
|
662
|
+
### All Corners
|
|
663
|
+
|
|
664
|
+
```scss
|
|
665
|
+
@mixin border-radius($size: "md") {
|
|
666
|
+
border-radius: map-get($dga-radius, $size);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// Usage
|
|
670
|
+
.my-card {
|
|
671
|
+
@include border-radius("lg");
|
|
672
|
+
}
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
### Top Corners
|
|
676
|
+
|
|
677
|
+
```scss
|
|
678
|
+
@mixin border-radius-top($size: "md") {
|
|
679
|
+
border-top-left-radius: map-get($dga-radius, $size);
|
|
680
|
+
border-top-right-radius: map-get($dga-radius, $size);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// Usage
|
|
684
|
+
.card-header {
|
|
685
|
+
@include border-radius-top("lg");
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
### Bottom Corners
|
|
690
|
+
|
|
691
|
+
```scss
|
|
692
|
+
@mixin border-radius-bottom($size: "md") {
|
|
693
|
+
border-bottom-left-radius: map-get($dga-radius, $size);
|
|
694
|
+
border-bottom-right-radius: map-get($dga-radius, $size);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Usage
|
|
698
|
+
.card-footer {
|
|
699
|
+
@include border-radius-bottom("lg");
|
|
700
|
+
}
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
### Left Corners
|
|
704
|
+
|
|
705
|
+
```scss
|
|
706
|
+
@mixin border-radius-left($size: "md") {
|
|
707
|
+
border-top-left-radius: map-get($dga-radius, $size);
|
|
708
|
+
border-bottom-left-radius: map-get($dga-radius, $size);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// Usage
|
|
712
|
+
.sidebar {
|
|
713
|
+
@include border-radius-left("md");
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### Right Corners
|
|
718
|
+
|
|
719
|
+
```scss
|
|
720
|
+
@mixin border-radius-right($size: "md") {
|
|
721
|
+
border-top-right-radius: map-get($dga-radius, $size);
|
|
722
|
+
border-bottom-right-radius: map-get($dga-radius, $size);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// Usage
|
|
726
|
+
.panel {
|
|
727
|
+
@include border-radius-right("md");
|
|
728
|
+
}
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
---
|
|
732
|
+
|
|
733
|
+
## Usage Examples
|
|
734
|
+
|
|
735
|
+
### Example 1: Card with Rounded Header
|
|
736
|
+
|
|
737
|
+
```html
|
|
738
|
+
<div class="dga-border dga-bg-white">
|
|
739
|
+
<!-- Header with rounded top -->
|
|
740
|
+
<div class="dga-bg-primary-500 dga-text-white dga-rounded-t-lg"
|
|
741
|
+
style="padding: 20px;">
|
|
742
|
+
<h3 style="margin: 0;">Card Title</h3>
|
|
743
|
+
</div>
|
|
744
|
+
|
|
745
|
+
<!-- Body -->
|
|
746
|
+
<div style="padding: 20px;">
|
|
747
|
+
<p>Card content goes here</p>
|
|
748
|
+
</div>
|
|
749
|
+
|
|
750
|
+
<!-- Footer -->
|
|
751
|
+
<div class="dga-bg-gray-50 dga-border-top dga-rounded-b-lg"
|
|
752
|
+
style="padding: 16px;">
|
|
753
|
+
<button class="dga-rounded-md">Action</button>
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
### Example 2: Input Group
|
|
759
|
+
|
|
760
|
+
```html
|
|
761
|
+
<div style="display: flex;">
|
|
762
|
+
<!-- Left input (rounded left only) -->
|
|
763
|
+
<input type="text"
|
|
764
|
+
class="dga-rounded-l-md dga-border"
|
|
765
|
+
placeholder="Search..."
|
|
766
|
+
style="flex: 1; padding: 10px; border-right: none;">
|
|
767
|
+
|
|
768
|
+
<!-- Right button (rounded right only) -->
|
|
769
|
+
<button class="dga-rounded-r-md dga-bg-primary-500 dga-text-white"
|
|
770
|
+
style="padding: 10px 20px; border: none;">
|
|
771
|
+
Search
|
|
772
|
+
</button>
|
|
773
|
+
</div>
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### Example 3: Stacked Cards
|
|
777
|
+
|
|
778
|
+
```html
|
|
779
|
+
<div style="display: flex; flex-direction: column; gap: 0;">
|
|
780
|
+
<!-- First card (rounded top) -->
|
|
781
|
+
<div class="dga-rounded-t-lg dga-border" style="padding: 16px;">
|
|
782
|
+
<h4>Card 1</h4>
|
|
783
|
+
</div>
|
|
784
|
+
|
|
785
|
+
<!-- Middle cards (no rounding) -->
|
|
786
|
+
<div class="dga-border dga-border-t-none" style="padding: 16px;">
|
|
787
|
+
<h4>Card 2</h4>
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
<div class="dga-border dga-border-t-none" style="padding: 16px;">
|
|
791
|
+
<h4>Card 3</h4>
|
|
792
|
+
</div>
|
|
793
|
+
|
|
794
|
+
<!-- Last card (rounded bottom) -->
|
|
795
|
+
<div class="dga-rounded-b-lg dga-border dga-border-t-none" style="padding: 16px;">
|
|
796
|
+
<h4>Card 4</h4>
|
|
797
|
+
</div>
|
|
798
|
+
</div>
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
### Example 4: Button Group
|
|
802
|
+
|
|
803
|
+
```html
|
|
804
|
+
<div style="display: inline-flex;">
|
|
805
|
+
<!-- First button (rounded left) -->
|
|
806
|
+
<button class="dga-rounded-l-md dga-bg-primary-500 dga-text-white"
|
|
807
|
+
style="padding: 10px 20px; border: none; border-right: 1px solid white;">
|
|
808
|
+
Option 1
|
|
809
|
+
</button>
|
|
810
|
+
|
|
811
|
+
<!-- Middle button (no rounding) -->
|
|
812
|
+
<button class="dga-bg-primary-500 dga-text-white"
|
|
813
|
+
style="padding: 10px 20px; border: none; border-right: 1px solid white;">
|
|
814
|
+
Option 2
|
|
815
|
+
</button>
|
|
816
|
+
|
|
817
|
+
<!-- Last button (rounded right) -->
|
|
818
|
+
<button class="dga-rounded-r-md dga-bg-primary-500 dga-text-white"
|
|
819
|
+
style="padding: 10px 20px; border: none;">
|
|
820
|
+
Option 3
|
|
821
|
+
</button>
|
|
822
|
+
</div>
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
### Example 5: Modal Dialog
|
|
826
|
+
|
|
827
|
+
```html
|
|
828
|
+
<div class="dga-rounded-xl dga-bg-white"
|
|
829
|
+
style="width: 500px; max-width: 90vw; overflow: hidden;">
|
|
830
|
+
|
|
831
|
+
<!-- Modal Header -->
|
|
832
|
+
<div class="dga-bg-gradient-primary dga-text-white"
|
|
833
|
+
style="padding: 24px;">
|
|
834
|
+
<h2 style="margin: 0;">Confirmation</h2>
|
|
835
|
+
</div>
|
|
836
|
+
|
|
837
|
+
<!-- Modal Body -->
|
|
838
|
+
<div style="padding: 24px;">
|
|
839
|
+
<p>Are you sure you want to proceed with this action?</p>
|
|
840
|
+
</div>
|
|
841
|
+
|
|
842
|
+
<!-- Modal Footer -->
|
|
843
|
+
<div class="dga-bg-gray-50 dga-border-top"
|
|
844
|
+
style="padding: 16px; display: flex; gap: 12px; justify-content: flex-end;">
|
|
845
|
+
<button class="dga-rounded-md dga-border dga-border-gray-300"
|
|
846
|
+
style="padding: 10px 20px;">
|
|
847
|
+
Cancel
|
|
848
|
+
</button>
|
|
849
|
+
<button class="dga-rounded-md dga-bg-primary-500 dga-text-white"
|
|
850
|
+
style="padding: 10px 20px; border: none;">
|
|
851
|
+
Confirm
|
|
852
|
+
</button>
|
|
853
|
+
</div>
|
|
854
|
+
</div>
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
### Example 6: Profile Card
|
|
858
|
+
|
|
859
|
+
```html
|
|
860
|
+
<div class="dga-rounded-lg dga-bg-white dga-border"
|
|
861
|
+
style="padding: 24px; text-align: center;">
|
|
862
|
+
|
|
863
|
+
<!-- Avatar -->
|
|
864
|
+
<img src="avatar.jpg"
|
|
865
|
+
class="dga-rounded-full"
|
|
866
|
+
style="width: 100px; height: 100px; object-fit: cover; margin: 0 auto;">
|
|
867
|
+
|
|
868
|
+
<!-- Name -->
|
|
869
|
+
<h3 style="margin: 16px 0 4px;">John Doe</h3>
|
|
870
|
+
<p class="dga-text-secondary" style="margin: 0 0 16px;">Software Engineer</p>
|
|
871
|
+
|
|
872
|
+
<!-- Status Badge -->
|
|
873
|
+
<span class="dga-rounded-full dga-bg-success-100 dga-text-success-700"
|
|
874
|
+
style="padding: 4px 12px; font-size: 14px;">
|
|
875
|
+
Available
|
|
876
|
+
</span>
|
|
877
|
+
|
|
878
|
+
<!-- Actions -->
|
|
879
|
+
<div style="margin-top: 24px; display: flex; gap: 12px; justify-content: center;">
|
|
880
|
+
<button class="dga-rounded-md dga-bg-primary-500 dga-text-white"
|
|
881
|
+
style="padding: 10px 20px; border: none;">
|
|
882
|
+
Message
|
|
883
|
+
</button>
|
|
884
|
+
<button class="dga-rounded-md dga-border dga-border-gray-300"
|
|
885
|
+
style="padding: 10px 20px; background: white;">
|
|
886
|
+
Follow
|
|
887
|
+
</button>
|
|
888
|
+
</div>
|
|
889
|
+
</div>
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
### Example 7: Notification Toast
|
|
893
|
+
|
|
894
|
+
```html
|
|
895
|
+
<div class="dga-rounded-lg dga-bg-white dga-border dga-border-success-200"
|
|
896
|
+
style="padding: 16px; display: flex; align-items: start; gap: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);">
|
|
897
|
+
|
|
898
|
+
<!-- Icon -->
|
|
899
|
+
<div class="dga-rounded-full dga-bg-success-500"
|
|
900
|
+
style="width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
|
901
|
+
<span style="color: white; font-size: 16px;">✓</span>
|
|
902
|
+
</div>
|
|
903
|
+
|
|
904
|
+
<!-- Content -->
|
|
905
|
+
<div style="flex: 1;">
|
|
906
|
+
<h4 class="dga-text-success-800" style="margin: 0 0 4px;">Success</h4>
|
|
907
|
+
<p class="dga-text-secondary" style="margin: 0; font-size: 14px;">
|
|
908
|
+
Your changes have been saved successfully.
|
|
909
|
+
</p>
|
|
910
|
+
</div>
|
|
911
|
+
|
|
912
|
+
<!-- Close button -->
|
|
913
|
+
<button class="dga-rounded-sm"
|
|
914
|
+
style="background: none; border: none; cursor: pointer; padding: 4px;">
|
|
915
|
+
✕
|
|
916
|
+
</button>
|
|
917
|
+
</div>
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
## Best Practices
|
|
923
|
+
|
|
924
|
+
### 1. Use Consistent Sizes
|
|
925
|
+
|
|
926
|
+
✅ **Good:**
|
|
927
|
+
```html
|
|
928
|
+
<!-- All buttons use the same radius -->
|
|
929
|
+
<button class="dga-rounded-md">Primary</button>
|
|
930
|
+
<button class="dga-rounded-md">Secondary</button>
|
|
931
|
+
<button class="dga-rounded-md">Tertiary</button>
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
❌ **Avoid:**
|
|
935
|
+
```html
|
|
936
|
+
<!-- Inconsistent radius sizes -->
|
|
937
|
+
<button class="dga-rounded-sm">Primary</button>
|
|
938
|
+
<button class="dga-rounded-lg">Secondary</button>
|
|
939
|
+
<button class="dga-rounded-xl">Tertiary</button>
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
---
|
|
943
|
+
|
|
944
|
+
### 2. Match Component Hierarchy
|
|
945
|
+
|
|
946
|
+
Larger, more important components should have larger radius:
|
|
947
|
+
|
|
948
|
+
```html
|
|
949
|
+
<!-- Modal (xl) > Card (lg) > Button (md) > Tag (sm) -->
|
|
950
|
+
<div class="dga-rounded-xl"><!-- Modal --></div>
|
|
951
|
+
<div class="dga-rounded-lg"><!-- Card --></div>
|
|
952
|
+
<button class="dga-rounded-md">Button</button>
|
|
953
|
+
<span class="dga-rounded-sm">Tag</span>
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
---
|
|
957
|
+
|
|
958
|
+
### 3. Round Interactive Elements
|
|
959
|
+
|
|
960
|
+
Make interactive elements more inviting:
|
|
961
|
+
|
|
962
|
+
```html
|
|
963
|
+
<!-- Interactive elements benefit from rounding -->
|
|
964
|
+
<button class="dga-rounded-md">Click me</button>
|
|
965
|
+
<a href="#" class="dga-rounded-md">Link</a>
|
|
966
|
+
<input class="dga-rounded-md">
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
---
|
|
970
|
+
|
|
971
|
+
### 4. Use Full Radius Sparingly
|
|
972
|
+
|
|
973
|
+
Reserve `full` radius for specific use cases:
|
|
974
|
+
|
|
975
|
+
✅ **Good uses:**
|
|
976
|
+
- Badges and status indicators
|
|
977
|
+
- Avatars and profile images
|
|
978
|
+
- Pill-shaped buttons (CTAs)
|
|
979
|
+
- Icon containers
|
|
980
|
+
|
|
981
|
+
❌ **Avoid:**
|
|
982
|
+
- Large cards
|
|
983
|
+
- Form containers
|
|
984
|
+
- Navigation menus
|
|
985
|
+
|
|
986
|
+
---
|
|
987
|
+
|
|
988
|
+
### 5. Consider Touch Targets
|
|
989
|
+
|
|
990
|
+
Rounded corners should not reduce touch/click areas:
|
|
991
|
+
|
|
992
|
+
```html
|
|
993
|
+
<!-- Maintain adequate padding with rounded corners -->
|
|
994
|
+
<button class="dga-rounded-md"
|
|
995
|
+
style="padding: 12px 24px; min-height: 44px;">
|
|
996
|
+
Touch-friendly button
|
|
997
|
+
</button>
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
---
|
|
1001
|
+
|
|
1002
|
+
### 6. Coordinate with Borders
|
|
1003
|
+
|
|
1004
|
+
Radius works best with borders:
|
|
1005
|
+
|
|
1006
|
+
```html
|
|
1007
|
+
<!-- Radius + border = defined shape -->
|
|
1008
|
+
<div class="dga-rounded-lg dga-border dga-border-gray-200">
|
|
1009
|
+
Card content
|
|
1010
|
+
</div>
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
---
|
|
1014
|
+
|
|
1015
|
+
### 7. Group Related Elements
|
|
1016
|
+
|
|
1017
|
+
Use side-specific radius for grouped elements:
|
|
1018
|
+
|
|
1019
|
+
```html
|
|
1020
|
+
<!-- Button group -->
|
|
1021
|
+
<div style="display: flex;">
|
|
1022
|
+
<button class="dga-rounded-l-md">Left</button>
|
|
1023
|
+
<button class="dga-rounded-r-md">Right</button>
|
|
1024
|
+
</div>
|
|
1025
|
+
|
|
1026
|
+
<!-- Accordion -->
|
|
1027
|
+
<div class="dga-rounded-t-lg dga-border">Item 1</div>
|
|
1028
|
+
<div class="dga-border dga-border-t-none">Item 2</div>
|
|
1029
|
+
<div class="dga-rounded-b-lg dga-border dga-border-t-none">Item 3</div>
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
---
|
|
1033
|
+
|
|
1034
|
+
### 8. Test Across Devices
|
|
1035
|
+
|
|
1036
|
+
Radius may appear different on various screen sizes:
|
|
1037
|
+
|
|
1038
|
+
```scss
|
|
1039
|
+
// Adjust for small screens if needed
|
|
1040
|
+
@media (max-width: 768px) {
|
|
1041
|
+
.my-card {
|
|
1042
|
+
border-radius: $dga-radius-md; // Smaller on mobile
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
---
|
|
1048
|
+
|
|
1049
|
+
### 9. Accessibility Considerations
|
|
1050
|
+
|
|
1051
|
+
- Rounded corners don't affect accessibility
|
|
1052
|
+
- Ensure sufficient contrast at edges
|
|
1053
|
+
- Maintain focus indicators on rounded elements
|
|
1054
|
+
|
|
1055
|
+
```html
|
|
1056
|
+
<!-- Focus ring on rounded button -->
|
|
1057
|
+
<button class="dga-rounded-md dga-focus-ring-primary">
|
|
1058
|
+
Accessible button
|
|
1059
|
+
</button>
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
---
|
|
1063
|
+
|
|
1064
|
+
### 10. Performance
|
|
1065
|
+
|
|
1066
|
+
Border radius is well-optimized, but:
|
|
1067
|
+
- Avoid animating border-radius (use transform instead)
|
|
1068
|
+
- Complex shapes with multiple radii are fine
|
|
1069
|
+
- Don't add radius to elements that don't need it
|
|
1070
|
+
|
|
1071
|
+
---
|
|
1072
|
+
|
|
1073
|
+
## Common Patterns
|
|
1074
|
+
|
|
1075
|
+
### Card Collection
|
|
1076
|
+
|
|
1077
|
+
```
|
|
1078
|
+
┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
1079
|
+
│ Card 1 │ │ Card 2 │ │ Card 3 │
|
|
1080
|
+
│ rounded │ │ rounded │ │ rounded │
|
|
1081
|
+
│ -lg │ │ -lg │ │ -lg │
|
|
1082
|
+
└─────────┘ └─────────┘ └─────────┘
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
### Button Group
|
|
1086
|
+
|
|
1087
|
+
```
|
|
1088
|
+
┌──────┬──────┬──────┐
|
|
1089
|
+
│ One │ Two │Three │
|
|
1090
|
+
│ l │ │ r │
|
|
1091
|
+
└──────┴──────┴──────┘
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
### Stacked List
|
|
1095
|
+
|
|
1096
|
+
```
|
|
1097
|
+
╭────────────────╮ ← rounded-t
|
|
1098
|
+
│ Item 1 │
|
|
1099
|
+
├────────────────┤
|
|
1100
|
+
│ Item 2 │
|
|
1101
|
+
├────────────────┤
|
|
1102
|
+
│ Item 3 │
|
|
1103
|
+
╰────────────────╯ ← rounded-b
|
|
1104
|
+
```
|
|
1105
|
+
|
|
1106
|
+
### Modal
|
|
1107
|
+
|
|
1108
|
+
```
|
|
1109
|
+
╭────────────────────╮ ← rounded-xl
|
|
1110
|
+
│ Modal Title │
|
|
1111
|
+
├────────────────────┤
|
|
1112
|
+
│ │
|
|
1113
|
+
│ Modal Content │
|
|
1114
|
+
│ │
|
|
1115
|
+
├────────────────────┤
|
|
1116
|
+
│ [Cancel] [Confirm]│
|
|
1117
|
+
╰────────────────────╯
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
---
|
|
1121
|
+
|
|
1122
|
+
## Quick Reference
|
|
1123
|
+
|
|
1124
|
+
### All Utilities
|
|
1125
|
+
|
|
1126
|
+
| Pattern | Example | Result |
|
|
1127
|
+
|---------|---------|--------|
|
|
1128
|
+
| `.dga-rounded-{size}` | `.dga-rounded-lg` | All corners |
|
|
1129
|
+
| `.dga-rounded-t-{size}` | `.dga-rounded-t-md` | Top corners |
|
|
1130
|
+
| `.dga-rounded-b-{size}` | `.dga-rounded-b-md` | Bottom corners |
|
|
1131
|
+
| `.dga-rounded-l-{size}` | `.dga-rounded-l-md` | Left corners |
|
|
1132
|
+
| `.dga-rounded-r-{size}` | `.dga-rounded-r-md` | Right corners |
|
|
1133
|
+
| `.dga-rounded-tl-{size}` | `.dga-rounded-tl-lg` | Top-left |
|
|
1134
|
+
| `.dga-rounded-tr-{size}` | `.dga-rounded-tr-lg` | Top-right |
|
|
1135
|
+
| `.dga-rounded-bl-{size}` | `.dga-rounded-bl-lg` | Bottom-left |
|
|
1136
|
+
| `.dga-rounded-br-{size}` | `.dga-rounded-br-lg` | Bottom-right |
|
|
1137
|
+
|
|
1138
|
+
### Size Values
|
|
1139
|
+
|
|
1140
|
+
| Size | Pixel | Use |
|
|
1141
|
+
|------|-------|-----|
|
|
1142
|
+
| `none` | 0px | Sharp |
|
|
1143
|
+
| `xs` | 2px | Subtle |
|
|
1144
|
+
| `sm` | 4px | Small |
|
|
1145
|
+
| `md` | 8px | Default ⭐ |
|
|
1146
|
+
| `lg` | 16px | Large |
|
|
1147
|
+
| `xl` | 24px | Extra large |
|
|
1148
|
+
| `full` | ∞ | Pill/Circle |
|
|
1149
|
+
|
|
1150
|
+
---
|
|
1151
|
+
|
|
1152
|
+
## Browser Support
|
|
1153
|
+
|
|
1154
|
+
All radius utilities support:
|
|
1155
|
+
|
|
1156
|
+
- ✅ Chrome (all versions)
|
|
1157
|
+
- ✅ Firefox (all versions)
|
|
1158
|
+
- ✅ Safari (all versions)
|
|
1159
|
+
- ✅ Edge (all versions)
|
|
1160
|
+
- ✅ IE 9+ (border-radius support)
|
|
1161
|
+
|
|
1162
|
+
---
|
|
1163
|
+
|
|
1164
|
+
**Version:** 1.0.0
|
|
1165
|
+
**Last Updated:** December 2024
|
|
1166
|
+
**Maintained by:** DGA Design Team
|