dynamic-ds 1.0.1 → 1.0.3
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 +1048 -175
- package/fesm2022/dynamic-ds.mjs +58 -16
- package/fesm2022/dynamic-ds.mjs.map +1 -1
- package/lib/dynamic-ds.module.d.ts +23 -0
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
- package/src/lib/styles/icons.scss +1791 -0
- package/src/lib/styles/system-design.scss +325 -137
package/README.md
CHANGED
|
@@ -1,80 +1,195 @@
|
|
|
1
1
|
# Dynamic-DS - Dynamic Design System
|
|
2
2
|
|
|
3
|
+
> **Modern Angular Design System** with dynamic theming, color customization, and icon system
|
|
4
|
+
|
|
3
5
|
[English](#english) | [Tiếng Việt](#tiếng-việt)
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## English
|
|
8
10
|
|
|
9
|
-
###
|
|
11
|
+
### Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Overview](#overview)
|
|
14
|
+
- [Key Features](#key-features)
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
- [Quick Start](#quick-start)
|
|
17
|
+
- [Usage](#usage)
|
|
18
|
+
- [Icon System (DSI)](#icon-system-dsi)
|
|
19
|
+
- [Available Icons](#available-icons)
|
|
20
|
+
- [Basic Icon Usage](#basic-icon-usage)
|
|
21
|
+
- [Icon Colors](#icon-colors)
|
|
22
|
+
- [Icon Sizes](#icon-sizes)
|
|
23
|
+
- [Icon Animations](#icon-animations)
|
|
24
|
+
- [Real-World Examples](#real-world-examples)
|
|
25
|
+
- [Color System](#color-system)
|
|
26
|
+
- [Semantic Classes Reference](#semantic-classes-reference)
|
|
27
|
+
- [Utility Classes](#utility-classes)
|
|
28
|
+
- [API Reference](#api-reference)
|
|
29
|
+
- [Additional Resources](#additional-resources)
|
|
30
|
+
- [Best Practices](#best-practices)
|
|
31
|
+
- [Migration Guide](#migration-guide)
|
|
32
|
+
- [Troubleshooting](#troubleshooting)
|
|
33
|
+
- [Contributing](#contributing)
|
|
34
|
+
- [License](#license)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### Overview
|
|
10
39
|
|
|
11
|
-
**Dynamic-DS (Dynamic Design System)** is
|
|
40
|
+
**Dynamic-DS (Dynamic Design System)** is a comprehensive Angular library that provides a flexible design system with dynamic theming capabilities. Build consistent, beautiful UIs with customizable brand colors, semantic utility classes, and a powerful icon system.
|
|
12
41
|
|
|
13
|
-
###
|
|
42
|
+
### Key Features
|
|
14
43
|
|
|
15
44
|
- **Dynamic Color Theming**: Customize brand, primary, secondary, functional, and utility colors
|
|
16
45
|
- **Automatic Palette Generation**: Generates 14 color shades (900-10) from a single base color
|
|
17
46
|
- **CSS Custom Properties**: All colors exposed as CSS variables for easy access
|
|
18
47
|
- **Semantic Color Classes**: Pre-built utility classes for backgrounds, text, borders, and icons
|
|
48
|
+
- **Icon System (DSI)**: Bootstrap Icons-style icon system with full color customization
|
|
19
49
|
- **Theme Badge Palettes**: 12 predefined color themes for badges and tags
|
|
20
50
|
- **RGB Mix Algorithm**: Accurate color shade generation using RGB mixing
|
|
21
51
|
- **Runtime Color Updates**: Change theme colors dynamically without page reload
|
|
52
|
+
- **TypeScript Support**: Full type definitions included
|
|
53
|
+
- **Responsive**: Works seamlessly across all screen sizes
|
|
22
54
|
|
|
23
|
-
###
|
|
55
|
+
### Installation
|
|
24
56
|
|
|
25
57
|
```bash
|
|
26
58
|
npm install dynamic-ds
|
|
27
59
|
```
|
|
28
60
|
|
|
29
|
-
###
|
|
61
|
+
### Quick Start
|
|
30
62
|
|
|
31
|
-
|
|
63
|
+
Follow these steps to integrate Dynamic-DS into your Angular application:
|
|
64
|
+
|
|
65
|
+
<details open>
|
|
66
|
+
<summary><strong>Step 1: Import Styles</strong></summary>
|
|
32
67
|
|
|
33
68
|
Add the design system styles to your `angular.json`:
|
|
34
69
|
|
|
35
70
|
```json
|
|
36
71
|
{
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
72
|
+
"projects": {
|
|
73
|
+
"your-app": {
|
|
74
|
+
"architect": {
|
|
75
|
+
"build": {
|
|
76
|
+
"options": {
|
|
77
|
+
"styles": ["node_modules/dynamic-ds/styles/system-design.scss", "src/styles.scss"]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
40
83
|
}
|
|
41
84
|
```
|
|
42
85
|
|
|
43
|
-
|
|
86
|
+
Or import directly in your `styles.scss`:
|
|
87
|
+
|
|
88
|
+
```scss
|
|
89
|
+
@import "dynamic-ds/styles/system-design.scss";
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
</details>
|
|
44
93
|
|
|
45
|
-
|
|
94
|
+
<details open>
|
|
95
|
+
<summary><strong>Step 2: Configure Theme Colors (Optional)</strong></summary>
|
|
96
|
+
|
|
97
|
+
#### For Module-based Apps
|
|
98
|
+
|
|
99
|
+
In your `app.module.ts`:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { NgModule } from "@angular/core";
|
|
103
|
+
import { BrowserModule } from "@angular/platform-browser";
|
|
104
|
+
import { DynamicDsModule } from "dynamic-ds";
|
|
105
|
+
import { AppComponent } from "./app.component";
|
|
106
|
+
|
|
107
|
+
@NgModule({
|
|
108
|
+
declarations: [AppComponent],
|
|
109
|
+
imports: [
|
|
110
|
+
BrowserModule,
|
|
111
|
+
DynamicDsModule.forRoot({
|
|
112
|
+
brand: "#2740B4",
|
|
113
|
+
primary: "#006BDF",
|
|
114
|
+
secondary: "#9F5100",
|
|
115
|
+
functional: "#006BDF",
|
|
116
|
+
utility: "#CF0026",
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
bootstrap: [AppComponent],
|
|
120
|
+
})
|
|
121
|
+
export class AppModule {}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### For Standalone Apps (Angular 14+)
|
|
125
|
+
|
|
126
|
+
In your `app.config.ts`:
|
|
46
127
|
|
|
47
128
|
```typescript
|
|
48
|
-
import { ApplicationConfig } from
|
|
49
|
-
import {
|
|
129
|
+
import { ApplicationConfig } from "@angular/core";
|
|
130
|
+
import { provideAnimations } from "@angular/platform-browser/animations";
|
|
131
|
+
import { SYSTEM_DESIGN_CONFIG } from "dynamic-ds";
|
|
50
132
|
|
|
51
133
|
export const appConfig: ApplicationConfig = {
|
|
52
134
|
providers: [
|
|
135
|
+
provideAnimations(),
|
|
53
136
|
{
|
|
54
137
|
provide: SYSTEM_DESIGN_CONFIG,
|
|
55
138
|
useValue: {
|
|
56
|
-
brand:
|
|
57
|
-
primary:
|
|
58
|
-
secondary:
|
|
59
|
-
functional:
|
|
60
|
-
utility:
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
139
|
+
brand: "#2740B4",
|
|
140
|
+
primary: "#006BDF",
|
|
141
|
+
secondary: "#9F5100",
|
|
142
|
+
functional: "#006BDF",
|
|
143
|
+
utility: "#CF0026",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
64
147
|
};
|
|
65
148
|
```
|
|
66
149
|
|
|
67
|
-
|
|
150
|
+
</details>
|
|
151
|
+
|
|
152
|
+
<details open>
|
|
153
|
+
<summary><strong>Step 3: Initialize Theme Service</strong></summary>
|
|
154
|
+
|
|
155
|
+
In your `app.component.ts`:
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
159
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
160
|
+
|
|
161
|
+
@Component({
|
|
162
|
+
selector: "app-root",
|
|
163
|
+
template: `
|
|
164
|
+
<div class="bg-primary-canvas">
|
|
165
|
+
<h1 class="text-primary-strong">Welcome to Dynamic-DS!</h1>
|
|
166
|
+
<i class="dsi dsi-activity-heart-solid dsi-primary-600 dsi-2x"></i>
|
|
167
|
+
</div>
|
|
168
|
+
`,
|
|
169
|
+
})
|
|
170
|
+
export class AppComponent implements OnInit {
|
|
171
|
+
private themeService = inject(DynamicDsService);
|
|
172
|
+
|
|
173
|
+
ngOnInit() {
|
|
174
|
+
// Initialize theme with config or defaults
|
|
175
|
+
this.themeService.initializeTheme().subscribe();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
</details>
|
|
181
|
+
|
|
182
|
+
**That's it!** You're ready to use Dynamic-DS components and utilities.
|
|
68
183
|
|
|
69
184
|
In your `app.component.ts`:
|
|
70
185
|
|
|
71
186
|
```typescript
|
|
72
|
-
import { Component, inject, OnInit } from
|
|
73
|
-
import { DynamicDsService } from
|
|
187
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
188
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
74
189
|
|
|
75
190
|
@Component({
|
|
76
|
-
selector:
|
|
77
|
-
template:
|
|
191
|
+
selector: "app-root",
|
|
192
|
+
template: `...`,
|
|
78
193
|
})
|
|
79
194
|
export class AppComponent implements OnInit {
|
|
80
195
|
private themeService = inject(DynamicDsService);
|
|
@@ -86,55 +201,150 @@ export class AppComponent implements OnInit {
|
|
|
86
201
|
}
|
|
87
202
|
```
|
|
88
203
|
|
|
89
|
-
###
|
|
204
|
+
### Usage
|
|
205
|
+
|
|
206
|
+
Dynamic-DS provides multiple ways to style your components:
|
|
207
|
+
|
|
208
|
+
<details open>
|
|
209
|
+
<summary><strong>1. Using Semantic CSS Classes</strong></summary>
|
|
90
210
|
|
|
91
|
-
|
|
211
|
+
The easiest way to apply design system colors:
|
|
92
212
|
|
|
93
213
|
```html
|
|
94
214
|
<!-- Background colors -->
|
|
95
|
-
<div class="bg-primary-canvas">Lightest background</div>
|
|
96
|
-
<div class="bg-primary-soft">Soft background</div>
|
|
97
|
-
<div class="bg-primary-
|
|
215
|
+
<div class="bg-primary-canvas">Lightest primary background</div>
|
|
216
|
+
<div class="bg-primary-soft">Soft primary background</div>
|
|
217
|
+
<div class="bg-primary-sub">Subtle primary background</div>
|
|
218
|
+
<div class="bg-primary-accent">Primary accent background</div>
|
|
98
219
|
|
|
99
220
|
<!-- Text colors -->
|
|
100
|
-
<p class="text-primary-strong">Strong text</p>
|
|
221
|
+
<p class="text-primary-strong">Strong primary text</p>
|
|
222
|
+
<p class="text-primary-sub">Subtle primary text</p>
|
|
101
223
|
<p class="text-neutral-soft">Soft neutral text</p>
|
|
224
|
+
<p class="text-neutral-strong">Strong neutral text</p>
|
|
102
225
|
|
|
103
226
|
<!-- Borders -->
|
|
104
|
-
<div class="stroke-primary-
|
|
227
|
+
<div class="stroke-primary-strong">Strong primary border</div>
|
|
228
|
+
<div class="stroke-primary-sub">Subtle primary border</div>
|
|
229
|
+
|
|
230
|
+
<!-- Icons (for icon fonts) -->
|
|
231
|
+
<i class="icon-primary-strong">★</i>
|
|
232
|
+
<i class="icon-neutral-soft">☆</i>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Available semantic types:**
|
|
236
|
+
|
|
237
|
+
- `brand`, `primary`, `secondary`, `functional`, `utility`
|
|
238
|
+
- `neutral`
|
|
239
|
+
- Badge themes: `red`, `orange`, `yellow`, `lime`, `green`, `ocean`, `blue`, `indigo`, `violet`, `pink`
|
|
240
|
+
|
|
241
|
+
</details>
|
|
242
|
+
|
|
243
|
+
<details open>
|
|
244
|
+
<summary><strong>2. Using Direct Color Utilities</strong></summary>
|
|
105
245
|
|
|
106
|
-
|
|
107
|
-
|
|
246
|
+
For precise color control with shade numbers:
|
|
247
|
+
|
|
248
|
+
```html
|
|
249
|
+
<!-- Backgrounds with specific shades -->
|
|
250
|
+
<div class="color-bg-primary-600">Primary 600 background</div>
|
|
251
|
+
<div class="color-bg-primary-100">Primary 100 background</div>
|
|
252
|
+
|
|
253
|
+
<!-- Text with specific shades -->
|
|
108
254
|
<p class="color-text-neutral-900">Neutral 900 text</p>
|
|
255
|
+
<p class="color-text-primary-700">Primary 700 text</p>
|
|
256
|
+
|
|
257
|
+
<!-- Borders with specific shades -->
|
|
258
|
+
<div class="color-stroke-primary-300">Primary 300 border</div>
|
|
109
259
|
```
|
|
110
260
|
|
|
111
|
-
|
|
261
|
+
**Available shades:** 10, 25, 50, 100, 200, 300, 400, 500, 600, 700, 800, 850, 875, 900
|
|
262
|
+
|
|
263
|
+
</details>
|
|
264
|
+
|
|
265
|
+
<details open>
|
|
266
|
+
<summary><strong>3. Using CSS Variables</strong></summary>
|
|
267
|
+
|
|
268
|
+
For advanced styling in your component SCSS/CSS files:
|
|
112
269
|
|
|
113
270
|
```scss
|
|
114
271
|
.my-component {
|
|
272
|
+
// Basic color usage
|
|
115
273
|
background-color: var(--primary-600);
|
|
116
274
|
color: var(--neutral-900);
|
|
117
275
|
border: 1px solid var(--primary-200);
|
|
276
|
+
|
|
277
|
+
// With alpha transparency
|
|
278
|
+
&::before {
|
|
279
|
+
background-color: rgba(var(--primary-600-rgb), 0.5);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Gradient example
|
|
283
|
+
background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
|
|
118
284
|
}
|
|
119
285
|
|
|
120
|
-
//
|
|
121
|
-
.
|
|
122
|
-
background-color:
|
|
286
|
+
// Hover states
|
|
287
|
+
.button:hover {
|
|
288
|
+
background-color: var(--primary-700);
|
|
289
|
+
border-color: var(--primary-800);
|
|
123
290
|
}
|
|
124
291
|
```
|
|
125
292
|
|
|
126
|
-
|
|
293
|
+
**All available CSS variables:**
|
|
294
|
+
|
|
295
|
+
```scss
|
|
296
|
+
// Dynamic colors (with all 14 shades: 10-900)
|
|
297
|
+
--brand-{shade}
|
|
298
|
+
--primary-{shade}
|
|
299
|
+
--secondary-{shade}
|
|
300
|
+
--functional-{shade}
|
|
301
|
+
--utility-{shade}
|
|
302
|
+
--neutral-{shade}
|
|
303
|
+
|
|
304
|
+
// RGB values for transparency
|
|
305
|
+
--brand-{shade}-rgb
|
|
306
|
+
--primary-{shade}-rgb
|
|
307
|
+
// ... etc
|
|
308
|
+
|
|
309
|
+
// Theme colors (for badges/tags)
|
|
310
|
+
--theme-red-{shade}
|
|
311
|
+
--theme-orange-{shade}
|
|
312
|
+
--theme-yellow-{shade}
|
|
313
|
+
--theme-lime-{shade}
|
|
314
|
+
--theme-green-{shade}
|
|
315
|
+
--theme-ocean-{shade}
|
|
316
|
+
--theme-blue-{shade}
|
|
317
|
+
--theme-indigo-{shade}
|
|
318
|
+
--theme-violet-{shade}
|
|
319
|
+
--theme-pink-{shade}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
</details>
|
|
323
|
+
|
|
324
|
+
<details open>
|
|
325
|
+
<summary><strong>4. Dynamic Color Updates</strong></summary>
|
|
326
|
+
|
|
327
|
+
Update theme colors at runtime programmatically:
|
|
127
328
|
|
|
128
329
|
```typescript
|
|
129
|
-
import {
|
|
330
|
+
import { Component, inject } from "@angular/core";
|
|
331
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
130
332
|
|
|
333
|
+
@Component({
|
|
334
|
+
selector: "app-settings",
|
|
335
|
+
template: `
|
|
336
|
+
<button (click)="updateTheme()">Change Theme</button>
|
|
337
|
+
<button (click)="resetTheme()">Reset Theme</button>
|
|
338
|
+
`,
|
|
339
|
+
})
|
|
131
340
|
export class SettingsComponent {
|
|
132
|
-
|
|
341
|
+
private themeService = inject(DynamicDsService);
|
|
133
342
|
|
|
134
343
|
updateTheme() {
|
|
135
344
|
this.themeService.updateSystemDesignColor({
|
|
136
|
-
primaryColor:
|
|
137
|
-
secondaryColor:
|
|
345
|
+
primaryColor: "#FF5733",
|
|
346
|
+
secondaryColor: "#33FF57",
|
|
347
|
+
brandColor: "#9C27B0",
|
|
138
348
|
});
|
|
139
349
|
}
|
|
140
350
|
|
|
@@ -145,75 +355,561 @@ export class SettingsComponent {
|
|
|
145
355
|
getCurrentColors() {
|
|
146
356
|
const colors = this.themeService.getCurrentColors();
|
|
147
357
|
console.log(colors);
|
|
148
|
-
// { brand: '#...', primary: '#...', secondary: '#...', ... }
|
|
358
|
+
// Output: { brand: '#...', primary: '#...', secondary: '#...', ... }
|
|
149
359
|
}
|
|
150
360
|
}
|
|
151
361
|
```
|
|
152
362
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
Each color type generates 14 shades:
|
|
156
|
-
|
|
157
|
-
| Shade | Usage | Mix Ratio |
|
|
158
|
-
|-------|-------|-----------|
|
|
159
|
-
| 900 | Darkest | -73.5% black |
|
|
160
|
-
| 875 | Very dark | -62.5% black |
|
|
161
|
-
| 850 | Darker | -47.0% black |
|
|
162
|
-
| 800 | Dark | -34.5% black |
|
|
163
|
-
| 700 | Medium dark | -18.5% black |
|
|
164
|
-
| 600 | **Base color** | 0% |
|
|
165
|
-
| 500 | Medium light | +17.5% white |
|
|
166
|
-
| 400 | Light | +33.0% white |
|
|
167
|
-
| 300 | Lighter | +53.0% white |
|
|
168
|
-
| 200 | Very light | +72.0% white |
|
|
169
|
-
| 100 | Ultra light | +85.0% white |
|
|
170
|
-
| 50 | Canvas | +89.5% white |
|
|
171
|
-
| 25 | Soft | +93.5% white |
|
|
172
|
-
| 10 | Lightest | +97.0% white |
|
|
173
|
-
|
|
174
|
-
### 🏷️ Semantic Classes
|
|
175
|
-
|
|
176
|
-
#### Backgrounds
|
|
177
|
-
- `.bg-{type}-canvas` - Lightest background
|
|
178
|
-
- `.bg-{type}-soft` - Soft background
|
|
179
|
-
- `.bg-{type}-sub` - Subtle background
|
|
180
|
-
- `.bg-{type}-accent` - Accent/primary background
|
|
181
|
-
|
|
182
|
-
#### Text
|
|
183
|
-
- `.text-{type}-soft` - Soft text color
|
|
184
|
-
- `.text-{type}-sub` - Subtle text color
|
|
185
|
-
- `.text-{type}-strong` - Strong/bold text color
|
|
186
|
-
- `.text-{type}-white` - White text
|
|
187
|
-
|
|
188
|
-
#### Strokes (Borders)
|
|
189
|
-
- `.stroke-{type}-soft` - Soft border
|
|
190
|
-
- `.stroke-{type}-sub` - Subtle border
|
|
191
|
-
- `.stroke-{type}-strong` - Strong border
|
|
192
|
-
- `.stroke-{type}-strong-alpha` - 50% opacity border
|
|
363
|
+
</details>
|
|
193
364
|
|
|
194
|
-
|
|
195
|
-
- `.icon-{type}-soft` - Soft icon color
|
|
196
|
-
- `.icon-{type}-sub` - Subtle icon color
|
|
197
|
-
- `.icon-{type}-strong` - Strong icon color
|
|
198
|
-
- `.icon-{type}-white` - White icon
|
|
365
|
+
---
|
|
199
366
|
|
|
200
|
-
|
|
367
|
+
### Icon System (DSI)
|
|
201
368
|
|
|
202
|
-
|
|
369
|
+
**Dynamic-DS** includes a powerful icon system similar to Bootstrap Icons, with full color customization support using CSS mask technique.
|
|
203
370
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- `red`, `orange`, `yellow`
|
|
207
|
-
- `lime`, `green`, `ocean`
|
|
208
|
-
- `blue`, `indigo`, `violet`, `pink`
|
|
371
|
+
<details open>
|
|
372
|
+
<summary><strong>Basic Icon Usage</strong></summary>
|
|
209
373
|
|
|
210
|
-
Example:
|
|
211
374
|
```html
|
|
212
|
-
|
|
213
|
-
<
|
|
375
|
+
<!-- Simple icon (default size, default color) -->
|
|
376
|
+
<i class="dsi dsi-activity-line"></i>
|
|
377
|
+
|
|
378
|
+
<!-- Icon with color from design system -->
|
|
379
|
+
<i class="dsi dsi-activity-line dsi-primary-600"></i>
|
|
380
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-red-600"></i>
|
|
381
|
+
<i class="dsi dsi-anchor-line dsi-brand-700"></i>
|
|
382
|
+
|
|
383
|
+
<!-- Icon with custom color using CSS variable -->
|
|
384
|
+
<i class="dsi dsi-anchor-line" style="color: var(--primary-600)"></i>
|
|
385
|
+
<i class="dsi dsi-activity-line" style="color: #FF6B00"></i>
|
|
386
|
+
|
|
387
|
+
<!-- Icon with size modifier -->
|
|
388
|
+
<i class="dsi dsi-activity-line dsi-xs"></i>
|
|
389
|
+
<!-- Extra small -->
|
|
390
|
+
<i class="dsi dsi-activity-line dsi-lg"></i>
|
|
391
|
+
<!-- Large -->
|
|
392
|
+
<i class="dsi dsi-activity-line dsi-2x"></i>
|
|
393
|
+
<!-- 2x size -->
|
|
394
|
+
|
|
395
|
+
<!-- Icon with animation -->
|
|
396
|
+
<i class="dsi dsi-activity-line dsi-spin"></i>
|
|
397
|
+
<!-- Rotating -->
|
|
398
|
+
<i class="dsi dsi-activity-heart-solid dsi-pulse"></i>
|
|
399
|
+
<!-- Pulsing -->
|
|
400
|
+
|
|
401
|
+
<!-- Combining everything -->
|
|
402
|
+
<i class="dsi dsi-activity-line dsi-primary-600 dsi-2x dsi-spin"></i>
|
|
214
403
|
```
|
|
215
404
|
|
|
216
|
-
|
|
405
|
+
</details>
|
|
406
|
+
|
|
407
|
+
<details open>
|
|
408
|
+
<summary><strong>Available Icons</strong></summary>
|
|
409
|
+
|
|
410
|
+
The library includes **117 icons** with both line and solid versions. Below is the complete list:
|
|
411
|
+
|
|
412
|
+
#### Activity & Status Icons
|
|
413
|
+
|
|
414
|
+
| Icon | Line | Solid | Class Names |
|
|
415
|
+
| -------------- | ------------------------------------------- | -------------------------------------------- | ---------------------------------------------------- |
|
|
416
|
+
| Activity |  |  | `dsi-activity-line` `dsi-activity-solid` |
|
|
417
|
+
| Activity Heart |  |  | `dsi-activity-heart-line` `dsi-activity-heart-solid` |
|
|
418
|
+
| Check Circle |  |  | `dsi-check-circle-line` `dsi-check-circle-solid` |
|
|
419
|
+
| Check Square |  |  | `dsi-check-square-line` `dsi-check-square-solid` |
|
|
420
|
+
| Info Circle |  |  | `dsi-info-circle-line` `dsi-info-circle-solid` |
|
|
421
|
+
| X Close |  |  | `dsi-x-close-line` `dsi-x-close-solid` |
|
|
422
|
+
|
|
423
|
+
#### Navigation Icons
|
|
424
|
+
|
|
425
|
+
| Icon | Line | Solid | Class Names |
|
|
426
|
+
| ---------- | --------------------------------------- | ---------------------------------------- | -------------------------------------------- |
|
|
427
|
+
| Anchor |  |  | `dsi-anchor-line` `dsi-anchor-solid` |
|
|
428
|
+
| Home 01 |  |  | `dsi-home-01-line` `dsi-home-01-solid` |
|
|
429
|
+
| Home 02 |  |  | `dsi-home-02-line` `dsi-home-02-solid` |
|
|
430
|
+
| Home 03 |  |  | `dsi-home-03-line` `dsi-home-03-solid` |
|
|
431
|
+
| Home 04 |  |  | `dsi-home-04-line` `dsi-home-04-solid` |
|
|
432
|
+
| Home 05 |  |  | `dsi-home-05-line` `dsi-home-05-solid` |
|
|
433
|
+
| Home Line |  |  | `dsi-home-line-line` `dsi-home-line-solid` |
|
|
434
|
+
| Home Smile |  |  | `dsi-home-smile-line` `dsi-home-smile-solid` |
|
|
435
|
+
|
|
436
|
+
#### Arrow Icons
|
|
437
|
+
|
|
438
|
+
| Icon | Line | Solid | Class Names |
|
|
439
|
+
| ---------------- | --------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------- |
|
|
440
|
+
| Arrow Up |  |  | `dsi-arrow-up-line` `dsi-arrow-up-solid` |
|
|
441
|
+
| Arrow Down |  |  | `dsi-arrow-down-line` `dsi-arrow-down-solid` |
|
|
442
|
+
| Arrow Left |  |  | `dsi-arrow-left-line` `dsi-arrow-left-solid` |
|
|
443
|
+
| Arrow Right |  |  | `dsi-arrow-right-line` `dsi-arrow-right-solid` |
|
|
444
|
+
| Arrow Up Left |  |  | `dsi-arrow-up-left-line` `dsi-arrow-up-left-solid` |
|
|
445
|
+
| Arrow Up Right |  |  | `dsi-arrow-up-right-line` `dsi-arrow-up-right-solid` |
|
|
446
|
+
| Arrow Down Left |  |  | `dsi-arrow-down-left-line` `dsi-arrow-down-left-solid` |
|
|
447
|
+
| Arrow Down Right |  |  | `dsi-arrow-down-right-line` `dsi-arrow-down-right-solid` |
|
|
448
|
+
|
|
449
|
+
#### Arrow Circle Icons
|
|
450
|
+
|
|
451
|
+
| Icon | Line | Solid | Class Names |
|
|
452
|
+
| ----------------------- | ---------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
453
|
+
| Arrow Circle Up |  |  | `dsi-arrow-circle-up-line` `dsi-arrow-circle-up-solid` |
|
|
454
|
+
| Arrow Circle Down |  |  | `dsi-arrow-circle-down-line` `dsi-arrow-circle-down-solid` |
|
|
455
|
+
| Arrow Circle Left |  |  | `dsi-arrow-circle-left-line` `dsi-arrow-circle-left-solid` |
|
|
456
|
+
| Arrow Circle Right |  |  | `dsi-arrow-circle-right-line` `dsi-arrow-circle-right-solid` |
|
|
457
|
+
| Arrow Circle Up Left |  |  | `dsi-arrow-circle-up-left-line` `dsi-arrow-circle-up-left-solid` |
|
|
458
|
+
| Arrow Circle Up Right |  |  | `dsi-arrow-circle-up-right-line` `dsi-arrow-circle-up-right-solid` |
|
|
459
|
+
| Arrow Circle Down Left |  |  | `dsi-arrow-circle-down-left-line` `dsi-arrow-circle-down-left-solid` |
|
|
460
|
+
| Arrow Circle Down Right |  |  | `dsi-arrow-circle-down-right-line` `dsi-arrow-circle-down-right-solid` |
|
|
461
|
+
|
|
462
|
+
#### Arrow Square Icons
|
|
463
|
+
|
|
464
|
+
| Icon | Line | Solid | Class Names |
|
|
465
|
+
| ----------------------- | ---------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
466
|
+
| Arrow Square Up |  |  | `dsi-arrow-square-up-line` `dsi-arrow-square-up-solid` |
|
|
467
|
+
| Arrow Square Down |  |  | `dsi-arrow-square-down-line` `dsi-arrow-square-down-solid` |
|
|
468
|
+
| Arrow Square Left |  |  | `dsi-arrow-square-left-line` `dsi-arrow-square-left-solid` |
|
|
469
|
+
| Arrow Square Right |  |  | `dsi-arrow-square-right-line` `dsi-arrow-square-right-solid` |
|
|
470
|
+
| Arrow Square Up Left |  |  | `dsi-arrow-square-up-left-line` `dsi-arrow-square-up-left-solid` |
|
|
471
|
+
| Arrow Square Up Right |  |  | `dsi-arrow-square-up-right-line` `dsi-arrow-square-up-right-solid` |
|
|
472
|
+
| Arrow Square Down Left |  |  | `dsi-arrow-square-down-left-line` `dsi-arrow-square-down-left-solid` |
|
|
473
|
+
| Arrow Square Down Right |  |  | `dsi-arrow-square-down-right-line` `dsi-arrow-square-down-right-solid` |
|
|
474
|
+
|
|
475
|
+
#### Arrow Block Icons
|
|
476
|
+
|
|
477
|
+
| Icon | Line | Solid | Class Names |
|
|
478
|
+
| ----------------- | ---------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------- |
|
|
479
|
+
| Arrow Block Up |  |  | `dsi-arrow-block-up-line` `dsi-arrow-block-up-solid` |
|
|
480
|
+
| Arrow Block Down |  |  | `dsi-arrow-block-down-line` `dsi-arrow-block-down-solid` |
|
|
481
|
+
| Arrow Block Left |  |  | `dsi-arrow-block-left-line` `dsi-arrow-block-left-solid` |
|
|
482
|
+
| Arrow Block Right |  |  | `dsi-arrow-block-right-line` `dsi-arrow-block-right-solid` |
|
|
483
|
+
|
|
484
|
+
#### Arrow Narrow Icons
|
|
485
|
+
|
|
486
|
+
| Icon | Line | Solid | Class Names |
|
|
487
|
+
| ----------------------- | ---------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
488
|
+
| Arrow Narrow Up |  |  | `dsi-arrow-narrow-up-line` `dsi-arrow-narrow-up-solid` |
|
|
489
|
+
| Arrow Narrow Down |  |  | `dsi-arrow-narrow-down-line` `dsi-arrow-narrow-down-solid` |
|
|
490
|
+
| Arrow Narrow Left |  |  | `dsi-arrow-narrow-left-line` `dsi-arrow-narrow-left-solid` |
|
|
491
|
+
| Arrow Narrow Right |  |  | `dsi-arrow-narrow-right-line` `dsi-arrow-narrow-right-solid` |
|
|
492
|
+
| Arrow Narrow Up Left |  |  | `dsi-arrow-narrow-up-left-line` `dsi-arrow-narrow-up-left-solid` |
|
|
493
|
+
| Arrow Narrow Up Right |  |  | `dsi-arrow-narrow-up-right-line` `dsi-arrow-narrow-up-right-solid` |
|
|
494
|
+
| Arrow Narrow Down Left |  |  | `dsi-arrow-narrow-down-left-line` `dsi-arrow-narrow-down-left-solid` |
|
|
495
|
+
| Arrow Narrow Down Right |  |  | `dsi-arrow-narrow-down-right-line` `dsi-arrow-narrow-down-right-solid` |
|
|
496
|
+
|
|
497
|
+
#### Arrow Circle Broken Icons
|
|
498
|
+
|
|
499
|
+
| Icon | Line | Solid | Class Names |
|
|
500
|
+
| ------------------------------ | ----------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
501
|
+
| Arrow Circle Broken Up |  |  | `dsi-arrow-circle-broken-up-line` `dsi-arrow-circle-broken-up-solid` |
|
|
502
|
+
| Arrow Circle Broken Down |  |  | `dsi-arrow-circle-broken-down-line` `dsi-arrow-circle-broken-down-solid` |
|
|
503
|
+
| Arrow Circle Broken Left |  |  | `dsi-arrow-circle-broken-left-line` `dsi-arrow-circle-broken-left-solid` |
|
|
504
|
+
| Arrow Circle Broken Right |  |  | `dsi-arrow-circle-broken-right-line` `dsi-arrow-circle-broken-right-solid` |
|
|
505
|
+
| Arrow Circle Broken Up Left |  |  | `dsi-arrow-circle-broken-up-left-line` `dsi-arrow-circle-broken-up-left-solid` |
|
|
506
|
+
| Arrow Circle Broken Up Right |  |  | `dsi-arrow-circle-broken-up-right-line` `dsi-arrow-circle-broken-up-right-solid` |
|
|
507
|
+
| Arrow Circle Broken Down Left |  |  | `dsi-arrow-circle-broken-down-left-line` `dsi-arrow-circle-broken-down-left-solid` |
|
|
508
|
+
| Arrow Circle Broken Down Right |  |  | `dsi-arrow-circle-broken-down-right-line` `dsi-arrow-circle-broken-down-right-solid` |
|
|
509
|
+
|
|
510
|
+
#### Multiple Arrows Icons
|
|
511
|
+
|
|
512
|
+
| Icon | Line | Solid | Class Names |
|
|
513
|
+
| --------------- | -------------------------------------------- | --------------------------------------------- | ------------------------------------------------------ |
|
|
514
|
+
| Arrows Up |  |  | `dsi-arrows-up-line` `dsi-arrows-up-solid` |
|
|
515
|
+
| Arrows Down |  |  | `dsi-arrows-down-line` `dsi-arrows-down-solid` |
|
|
516
|
+
| Arrows Left |  |  | `dsi-arrows-left-line` `dsi-arrows-left-solid` |
|
|
517
|
+
| Arrows Right |  |  | `dsi-arrows-right-line` `dsi-arrows-right-solid` |
|
|
518
|
+
| Arrows Triangle |  |  | `dsi-arrows-triangle-line` `dsi-arrows-triangle-solid` |
|
|
519
|
+
|
|
520
|
+
#### Mail Icons
|
|
521
|
+
|
|
522
|
+
| Icon | Line | Solid | Class Names |
|
|
523
|
+
| ------- | ------------------------------------ | ------------------------------------- | -------------------------------------- |
|
|
524
|
+
| Mail 01 |  |  | `dsi-mail-01-line` `dsi-mail-01-solid` |
|
|
525
|
+
| Mail 02 |  |  | `dsi-mail-02-line` `dsi-mail-02-solid` |
|
|
526
|
+
| Mail 03 |  |  | `dsi-mail-03-line` `dsi-mail-03-solid` |
|
|
527
|
+
| Mail 04 |  |  | `dsi-mail-04-line` `dsi-mail-04-solid` |
|
|
528
|
+
| Mail 05 |  |  | `dsi-mail-05-line` `dsi-mail-05-solid` |
|
|
529
|
+
|
|
530
|
+
#### Notification Icons
|
|
531
|
+
|
|
532
|
+
| Icon | Line | Solid | Class Names |
|
|
533
|
+
| --------------------------- | -------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
534
|
+
| Notification Box |  |  | `dsi-notification-box-line` `dsi-notification-box-solid` |
|
|
535
|
+
| Notification Message |  |  | `dsi-notification-message-line` `dsi-notification-message-solid` |
|
|
536
|
+
| Notification Text |  |  | `dsi-notification-text-line` `dsi-notification-text-solid` |
|
|
537
|
+
| Message Notification Circle |  |  | `dsi-message-notification-circle-line` `dsi-message-notification-circle-solid` |
|
|
538
|
+
| Message Notification Square |  |  | `dsi-message-notification-square-line` `dsi-message-notification-square-solid` |
|
|
539
|
+
|
|
540
|
+
#### Star Icons
|
|
541
|
+
|
|
542
|
+
| Icon | Line | Solid | Class Names |
|
|
543
|
+
| -------- | ------------------------------------- | -------------------------------------- | ---------------------------------------- |
|
|
544
|
+
| Star 01 |  |  | `dsi-star-01-line` `dsi-star-01-solid` |
|
|
545
|
+
| Star 02 |  |  | `dsi-star-02-line` `dsi-star-02-solid` |
|
|
546
|
+
| Star 03 |  |  | `dsi-star-03-line` `dsi-star-03-solid` |
|
|
547
|
+
| Star 04 |  |  | `dsi-star-04-line` `dsi-star-04-solid` |
|
|
548
|
+
| Star 05 |  |  | `dsi-star-05-line` `dsi-star-05-solid` |
|
|
549
|
+
| Star 06 |  |  | `dsi-star-06-line` `dsi-star-06-solid` |
|
|
550
|
+
| Star 07 |  |  | `dsi-star-07-line` `dsi-star-07-solid` |
|
|
551
|
+
| Stars 01 |  |  | `dsi-stars-01-line` `dsi-stars-01-solid` |
|
|
552
|
+
| Stars 02 |  |  | `dsi-stars-02-line` `dsi-stars-02-solid` |
|
|
553
|
+
| Stars 03 |  |  | `dsi-stars-03-line` `dsi-stars-03-solid` |
|
|
554
|
+
|
|
555
|
+
#### User Icons
|
|
556
|
+
|
|
557
|
+
| Icon | Line | Solid | Class Names |
|
|
558
|
+
| ------------- | ------------------------------------------ | ------------------------------------------- | -------------------------------------------------- |
|
|
559
|
+
| User 01 |  |  | `dsi-user-01-line` `dsi-user-01-solid` |
|
|
560
|
+
| User 02 |  |  | `dsi-user-02-line` `dsi-user-02-solid` |
|
|
561
|
+
| User 03 |  |  | `dsi-user-03-line` `dsi-user-03-solid` |
|
|
562
|
+
| User Circle |  |  | `dsi-user-circle-line` `dsi-user-circle-solid` |
|
|
563
|
+
| User Square |  |  | `dsi-user-square-line` `dsi-user-square-solid` |
|
|
564
|
+
| User Check 01 |  |  | `dsi-user-check-01-line` `dsi-user-check-01-solid` |
|
|
565
|
+
| User Check 02 |  |  | `dsi-user-check-02-line` `dsi-user-check-02-solid` |
|
|
566
|
+
| User Plus 01 |  |  | `dsi-user-plus-01-line` `dsi-user-plus-01-solid` |
|
|
567
|
+
| User Plus 02 |  |  | `dsi-user-plus-02-line` `dsi-user-plus-02-solid` |
|
|
568
|
+
| User Minus 01 |  |  | `dsi-user-minus-01-line` `dsi-user-minus-01-solid` |
|
|
569
|
+
| User Minus 02 |  |  | `dsi-user-minus-02-line` `dsi-user-minus-02-solid` |
|
|
570
|
+
| User X 01 |  |  | `dsi-user-x-01-line` `dsi-user-x-01-solid` |
|
|
571
|
+
| User X 02 |  |  | `dsi-user-x-02-line` `dsi-user-x-02-solid` |
|
|
572
|
+
| User Edit |  |  | `dsi-user-edit-line` `dsi-user-edit-solid` |
|
|
573
|
+
| User Up 01 |  |  | `dsi-user-up-01-line` `dsi-user-up-01-solid` |
|
|
574
|
+
| User Up 02 |  |  | `dsi-user-up-02-line` `dsi-user-up-02-solid` |
|
|
575
|
+
| User Down 01 |  |  | `dsi-user-down-01-line` `dsi-user-down-01-solid` |
|
|
576
|
+
| User Down 02 |  |  | `dsi-user-down-02-line` `dsi-user-down-02-solid` |
|
|
577
|
+
| User Left 01 |  |  | `dsi-user-left-01-line` `dsi-user-left-01-solid` |
|
|
578
|
+
| User Left 02 |  |  | `dsi-user-left-02-line` `dsi-user-left-02-solid` |
|
|
579
|
+
| User Right 01 |  |  | `dsi-user-right-01-line` `dsi-user-right-01-solid` |
|
|
580
|
+
| User Right 02 |  |  | `dsi-user-right-02-line` `dsi-user-right-02-solid` |
|
|
581
|
+
|
|
582
|
+
#### Users (Multiple) Icons
|
|
583
|
+
|
|
584
|
+
| Icon | Line | Solid | Class Names |
|
|
585
|
+
| ----------- | ---------------------------------------- | ----------------------------------------- | ---------------------------------------------- |
|
|
586
|
+
| Users 01 |  |  | `dsi-users-01-line` `dsi-users-01-solid` |
|
|
587
|
+
| Users 02 |  |  | `dsi-users-02-line` `dsi-users-02-solid` |
|
|
588
|
+
| Users 03 |  |  | `dsi-users-03-line` `dsi-users-03-solid` |
|
|
589
|
+
| Users Check |  |  | `dsi-users-check-line` `dsi-users-check-solid` |
|
|
590
|
+
| Users Plus |  |  | `dsi-users-plus-line` `dsi-users-plus-solid` |
|
|
591
|
+
| Users Minus |  |  | `dsi-users-minus-line` `dsi-users-minus-solid` |
|
|
592
|
+
| Users X |  |  | `dsi-users-x-line` `dsi-users-x-solid` |
|
|
593
|
+
| Users Edit |  |  | `dsi-users-edit-line` `dsi-users-edit-solid` |
|
|
594
|
+
| Users Up |  |  | `dsi-users-up-line` `dsi-users-up-solid` |
|
|
595
|
+
| Users Down |  |  | `dsi-users-down-line` `dsi-users-down-solid` |
|
|
596
|
+
| Users Left |  |  | `dsi-users-left-line` `dsi-users-left-solid` |
|
|
597
|
+
| Users Right |  |  | `dsi-users-right-line` `dsi-users-right-solid` |
|
|
598
|
+
|
|
599
|
+
**To generate icon classes:**
|
|
600
|
+
|
|
601
|
+
```bash
|
|
602
|
+
npm run generate:icons
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
This command will scan the `assets/` folder and automatically generate CSS classes for all SVG files.
|
|
606
|
+
|
|
607
|
+
</details>
|
|
608
|
+
|
|
609
|
+
<details open>
|
|
610
|
+
<summary><strong>Icon Colors</strong></summary>
|
|
611
|
+
|
|
612
|
+
Use any color from the design system:
|
|
613
|
+
|
|
614
|
+
```html
|
|
615
|
+
<!-- Dynamic colors -->
|
|
616
|
+
<i class="dsi dsi-activity-line dsi-brand-600"></i>
|
|
617
|
+
<i class="dsi dsi-activity-line dsi-primary-600"></i>
|
|
618
|
+
<i class="dsi dsi-activity-line dsi-primary-700"></i>
|
|
619
|
+
<i class="dsi dsi-activity-line dsi-secondary-600"></i>
|
|
620
|
+
<i class="dsi dsi-activity-line dsi-functional-600"></i>
|
|
621
|
+
<i class="dsi dsi-activity-line dsi-utility-600"></i>
|
|
622
|
+
|
|
623
|
+
<!-- Theme colors -->
|
|
624
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-red-600"></i>
|
|
625
|
+
<i class="dsi dsi-anchor-line dsi-theme-blue-600"></i>
|
|
626
|
+
<i class="dsi dsi-activity-line dsi-theme-green-600"></i>
|
|
627
|
+
<i class="dsi dsi-activity-line dsi-theme-violet-600"></i>
|
|
628
|
+
|
|
629
|
+
<!-- Neutral shades -->
|
|
630
|
+
<i class="dsi dsi-activity-line dsi-neutral-900"></i>
|
|
631
|
+
<i class="dsi dsi-activity-line dsi-neutral-600"></i>
|
|
632
|
+
<i class="dsi dsi-activity-line dsi-neutral-300"></i>
|
|
633
|
+
|
|
634
|
+
<!-- Or use CSS variables for custom colors -->
|
|
635
|
+
<i class="dsi dsi-activity-line" style="color: var(--primary-600)"></i>
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
</details>
|
|
639
|
+
|
|
640
|
+
<details open>
|
|
641
|
+
<summary><strong>Icon Sizes</strong></summary>
|
|
642
|
+
|
|
643
|
+
```html
|
|
644
|
+
<i class="dsi dsi-activity-line dsi-xs"></i>
|
|
645
|
+
<!-- 0.75em / 12px -->
|
|
646
|
+
<i class="dsi dsi-activity-line dsi-sm"></i>
|
|
647
|
+
<!-- 0.875em / 14px -->
|
|
648
|
+
<i class="dsi dsi-activity-line"></i>
|
|
649
|
+
<!-- 1em / 16px (default) -->
|
|
650
|
+
<i class="dsi dsi-activity-line dsi-lg"></i>
|
|
651
|
+
<!-- 1.25em / 20px -->
|
|
652
|
+
<i class="dsi dsi-activity-line dsi-xl"></i>
|
|
653
|
+
<!-- 1.5em / 24px -->
|
|
654
|
+
<i class="dsi dsi-activity-line dsi-2x"></i>
|
|
655
|
+
<!-- 2em / 32px -->
|
|
656
|
+
<i class="dsi dsi-activity-line dsi-3x"></i>
|
|
657
|
+
<!-- 3em / 48px -->
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
Icons scale with font-size, so they automatically adapt to their container's text size.
|
|
661
|
+
|
|
662
|
+
</details>
|
|
663
|
+
|
|
664
|
+
<details open>
|
|
665
|
+
<summary><strong>Icon Animations</strong></summary>
|
|
666
|
+
|
|
667
|
+
```html
|
|
668
|
+
<!-- Spinning animation (360° rotation) -->
|
|
669
|
+
<i class="dsi dsi-activity-line dsi-spin"></i>
|
|
670
|
+
|
|
671
|
+
<!-- Pulsing animation (opacity fade) -->
|
|
672
|
+
<i class="dsi dsi-activity-heart-solid dsi-pulse"></i>
|
|
673
|
+
|
|
674
|
+
<!-- Combined with colors and sizes -->
|
|
675
|
+
<i class="dsi dsi-activity-line dsi-primary-600 dsi-2x dsi-spin"></i>
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
</details>
|
|
679
|
+
|
|
680
|
+
<details open>
|
|
681
|
+
<summary><strong>Real-World Examples</strong></summary>
|
|
682
|
+
|
|
683
|
+
```html
|
|
684
|
+
<!-- Button with icon -->
|
|
685
|
+
<button class="btn btn-primary">
|
|
686
|
+
<i class="dsi dsi-activity-heart-solid"></i>
|
|
687
|
+
Like
|
|
688
|
+
</button>
|
|
689
|
+
|
|
690
|
+
<!-- Loading state -->
|
|
691
|
+
<div class="loading">
|
|
692
|
+
<i class="dsi dsi-activity-line dsi-spin dsi-primary-600 dsi-lg"></i>
|
|
693
|
+
<span>Loading...</span>
|
|
694
|
+
</div>
|
|
695
|
+
|
|
696
|
+
<!-- Success alert -->
|
|
697
|
+
<div class="alert alert-success">
|
|
698
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-green-600 dsi-xl"></i>
|
|
699
|
+
<span>Operation completed successfully!</span>
|
|
700
|
+
</div>
|
|
701
|
+
|
|
702
|
+
<!-- Error alert -->
|
|
703
|
+
<div class="alert alert-error">
|
|
704
|
+
<i class="dsi dsi-anchor-solid dsi-theme-red-600 dsi-xl"></i>
|
|
705
|
+
<span>Connection failed. Please try again.</span>
|
|
706
|
+
</div>
|
|
707
|
+
|
|
708
|
+
<!-- Navigation item with icon -->
|
|
709
|
+
<a href="/dashboard" class="nav-item">
|
|
710
|
+
<i class="dsi dsi-activity-line dsi-neutral-600"></i>
|
|
711
|
+
<span>Dashboard</span>
|
|
712
|
+
</a>
|
|
713
|
+
|
|
714
|
+
<!-- Status indicator -->
|
|
715
|
+
<div class="status">
|
|
716
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-green-600 dsi-pulse"></i>
|
|
717
|
+
<span>Online</span>
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
<!-- Icon in heading -->
|
|
721
|
+
<h2>
|
|
722
|
+
<i class="dsi dsi-anchor-line dsi-primary-600"></i>
|
|
723
|
+
Documentation
|
|
724
|
+
</h2>
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
</details>
|
|
728
|
+
|
|
729
|
+
**📚 Complete Icon Documentation:**
|
|
730
|
+
|
|
731
|
+
- [Full Icon System Guide](./ICON_SYSTEM.md)
|
|
732
|
+
- [Icon Quick Start](../../ICON_QUICK_START.md)
|
|
733
|
+
- [Icon Cheat Sheet](../../ICON_CHEATSHEET.md)
|
|
734
|
+
|
|
735
|
+
---
|
|
736
|
+
|
|
737
|
+
### Color System
|
|
738
|
+
|
|
739
|
+
<details open>
|
|
740
|
+
<summary><strong>Color Palette Structure</strong></summary>
|
|
741
|
+
|
|
742
|
+
Each color type (brand, primary, secondary, etc.) generates **14 shades** automatically:
|
|
743
|
+
|
|
744
|
+
| Shade | Usage | Lightness | Example Use Case |
|
|
745
|
+
| ------- | -------------- | --------- | ----------------------------- |
|
|
746
|
+
| **900** | Darkest | -73.5% | Text on light backgrounds |
|
|
747
|
+
| **875** | Very dark | -62.5% | Strong text, dark UI elements |
|
|
748
|
+
| **850** | Darker | -47.0% | Hover states (dark mode) |
|
|
749
|
+
| **800** | Dark | -34.5% | Secondary text |
|
|
750
|
+
| **700** | Medium dark | -18.5% | Borders, dividers |
|
|
751
|
+
| **600** | **Base color** | 0% | **Primary buttons, main UI** |
|
|
752
|
+
| **500** | Medium light | +17.5% | Hover states (light mode) |
|
|
753
|
+
| **400** | Light | +33.0% | Disabled states, placeholders |
|
|
754
|
+
| **300** | Lighter | +53.0% | Light borders |
|
|
755
|
+
| **200** | Very light | +72.0% | Subtle backgrounds |
|
|
756
|
+
| **100** | Ultra light | +85.0% | Card backgrounds |
|
|
757
|
+
| **50** | Canvas | +89.5% | Page backgrounds |
|
|
758
|
+
| **25** | Soft | +93.5% | Very subtle backgrounds |
|
|
759
|
+
| **10** | Lightest | +97.0% | Barely visible backgrounds |
|
|
760
|
+
|
|
761
|
+
**Color mixing is done using RGB algorithm**, ensuring accurate and consistent results.
|
|
762
|
+
|
|
763
|
+
</details>
|
|
764
|
+
|
|
765
|
+
<details open>
|
|
766
|
+
<summary><strong>Available Color Types</strong></summary>
|
|
767
|
+
|
|
768
|
+
#### Dynamic Colors (Customizable)
|
|
769
|
+
|
|
770
|
+
- **brand** - Your company/product brand color
|
|
771
|
+
- **primary** - Main interactive elements (buttons, links, etc.)
|
|
772
|
+
- **secondary** - Secondary actions and content
|
|
773
|
+
- **functional** - Functional UI elements
|
|
774
|
+
- **utility** - Alerts, notifications, warnings
|
|
775
|
+
- **neutral** - Text, borders, backgrounds
|
|
776
|
+
|
|
777
|
+
#### Theme Colors (Fixed palette for badges/tags)
|
|
778
|
+
|
|
779
|
+
- **red**, **orange**, **yellow**
|
|
780
|
+
- **lime**, **green**, **ocean**
|
|
781
|
+
- **blue**, **indigo**, **violet**, **pink**
|
|
782
|
+
|
|
783
|
+
</details>
|
|
784
|
+
|
|
785
|
+
<details>
|
|
786
|
+
<summary><strong>Default Color Values</strong></summary>
|
|
787
|
+
|
|
788
|
+
| Type | Default Value | RGB |
|
|
789
|
+
| ---------- | ------------- | ---------------- |
|
|
790
|
+
| Brand | `#2740B4` | rgb(39, 64, 180) |
|
|
791
|
+
| Primary | `#006BDF` | rgb(0, 107, 223) |
|
|
792
|
+
| Secondary | `#9F5100` | rgb(159, 81, 0) |
|
|
793
|
+
| Functional | `#006BDF` | rgb(0, 107, 223) |
|
|
794
|
+
| Utility | `#CF0026` | rgb(207, 0, 38) |
|
|
795
|
+
| Neutral | `#505A5F` | rgb(80, 90, 95) |
|
|
796
|
+
|
|
797
|
+
</details>
|
|
798
|
+
|
|
799
|
+
---
|
|
800
|
+
|
|
801
|
+
### Semantic Classes Reference
|
|
802
|
+
|
|
803
|
+
<details open>
|
|
804
|
+
<summary><strong>Background Classes</strong></summary>
|
|
805
|
+
|
|
806
|
+
```html
|
|
807
|
+
<!-- Semantic backgrounds -->
|
|
808
|
+
<div class="bg-{type}-canvas">
|
|
809
|
+
<!-- Lightest: shade 10 -->
|
|
810
|
+
<div class="bg-{type}-soft">
|
|
811
|
+
<!-- Soft: shade 25 -->
|
|
812
|
+
<div class="bg-{type}-sub">
|
|
813
|
+
<!-- Subtle: shade 50 -->
|
|
814
|
+
<div class="bg-{type}-accent">
|
|
815
|
+
<!-- Accent: shade 600 -->
|
|
816
|
+
|
|
817
|
+
<!-- Direct shade backgrounds -->
|
|
818
|
+
<div class="color-bg-{type}-{shade}">
|
|
819
|
+
<!-- Examples -->
|
|
820
|
+
<div class="bg-primary-canvas">Lightest primary background</div>
|
|
821
|
+
<div class="bg-neutral-soft">Soft neutral background</div>
|
|
822
|
+
<div class="color-bg-primary-600">Primary 600 background</div>
|
|
823
|
+
</div>
|
|
824
|
+
</div>
|
|
825
|
+
</div>
|
|
826
|
+
</div>
|
|
827
|
+
</div>
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
</details>
|
|
831
|
+
|
|
832
|
+
<details open>
|
|
833
|
+
<summary><strong>Text Classes</strong></summary>
|
|
834
|
+
|
|
835
|
+
```html
|
|
836
|
+
<!-- Semantic text -->
|
|
837
|
+
<p class="text-{type}-soft"><!-- Soft: shade 300 --></p>
|
|
838
|
+
<p class="text-{type}-sub"><!-- Subtle: shade 600 --></p>
|
|
839
|
+
<p class="text-{type}-strong"><!-- Strong: shade 900 --></p>
|
|
840
|
+
<p class="text-{type}-white">
|
|
841
|
+
<!-- White text -->
|
|
842
|
+
|
|
843
|
+
<!-- Direct shade text -->
|
|
844
|
+
</p>
|
|
845
|
+
|
|
846
|
+
<p class="color-text-{type}-{shade}">
|
|
847
|
+
<!-- Examples -->
|
|
848
|
+
</p>
|
|
849
|
+
|
|
850
|
+
<p class="text-primary-strong">Strong primary text</p>
|
|
851
|
+
<p class="text-neutral-soft">Soft neutral text</p>
|
|
852
|
+
<p class="color-text-primary-700">Primary 700 text</p>
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
</details>
|
|
856
|
+
|
|
857
|
+
<details open>
|
|
858
|
+
<summary><strong>Border/Stroke Classes</strong></summary>
|
|
859
|
+
|
|
860
|
+
```html
|
|
861
|
+
<!-- Semantic strokes -->
|
|
862
|
+
<div class="stroke-{type}-soft">
|
|
863
|
+
<!-- Soft: shade 100 -->
|
|
864
|
+
<div class="stroke-{type}-sub">
|
|
865
|
+
<!-- Subtle: shade 300 -->
|
|
866
|
+
<div class="stroke-{type}-strong">
|
|
867
|
+
<!-- Strong: shade 900 -->
|
|
868
|
+
<div class="stroke-{type}-strong-alpha">
|
|
869
|
+
<!-- 50% opacity -->
|
|
870
|
+
|
|
871
|
+
<!-- Direct shade strokes -->
|
|
872
|
+
<div class="color-stroke-{type}-{shade}">
|
|
873
|
+
<!-- Examples -->
|
|
874
|
+
<div class="stroke-primary-sub">Subtle primary border</div>
|
|
875
|
+
<div class="stroke-neutral-strong">Strong neutral border</div>
|
|
876
|
+
<div class="color-stroke-primary-300">Primary 300 border</div>
|
|
877
|
+
</div>
|
|
878
|
+
</div>
|
|
879
|
+
</div>
|
|
880
|
+
</div>
|
|
881
|
+
</div>
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
</details>
|
|
885
|
+
|
|
886
|
+
<details open>
|
|
887
|
+
<summary><strong>Icon Color Classes</strong></summary>
|
|
888
|
+
|
|
889
|
+
```html
|
|
890
|
+
<!-- Semantic icon colors (for icon fonts, not DSI icons) -->
|
|
891
|
+
<i class="icon-{type}-soft">
|
|
892
|
+
<!-- Soft: shade 300 -->
|
|
893
|
+
<i class="icon-{type}-sub">
|
|
894
|
+
<!-- Subtle: shade 600 -->
|
|
895
|
+
<i class="icon-{type}-strong">
|
|
896
|
+
<!-- Strong: shade 900 -->
|
|
897
|
+
<i class="icon-{type}-white">
|
|
898
|
+
<!-- White icon -->
|
|
899
|
+
|
|
900
|
+
<!-- For DSI icons, use dsi-{type}-{shade} classes -->
|
|
901
|
+
<i class="dsi dsi-activity-line dsi-primary-600"></i></i></i></i
|
|
902
|
+
></i>
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
</details>
|
|
906
|
+
|
|
907
|
+
_Replace `{type}` with: `brand`, `primary`, `secondary`, `functional`, `utility`, `neutral`, `red`, `blue`, `green`, etc._
|
|
908
|
+
_Replace `{shade}` with: `10`, `25`, `50`, `100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `850`, `875`, `900`_
|
|
909
|
+
|
|
910
|
+
---
|
|
911
|
+
|
|
912
|
+
### Utility Classes
|
|
217
913
|
|
|
218
914
|
```html
|
|
219
915
|
<!-- Heights -->
|
|
@@ -238,7 +934,7 @@ Example:
|
|
|
238
934
|
<div class="rounded-full">999px radius</div>
|
|
239
935
|
```
|
|
240
936
|
|
|
241
|
-
###
|
|
937
|
+
### API Reference
|
|
242
938
|
|
|
243
939
|
#### DynamicDsService
|
|
244
940
|
|
|
@@ -251,32 +947,33 @@ Example:
|
|
|
251
947
|
- `resetToDefaults(): void` - Reset all colors to default values
|
|
252
948
|
|
|
253
949
|
**Example:**
|
|
950
|
+
|
|
254
951
|
```typescript
|
|
255
952
|
// Initialize on app start
|
|
256
953
|
themeService.initializeTheme().subscribe();
|
|
257
954
|
|
|
258
955
|
// Update colors later
|
|
259
956
|
themeService.updateSystemDesignColor({
|
|
260
|
-
primaryColor:
|
|
261
|
-
brandColor:
|
|
957
|
+
primaryColor: "#FF6B00",
|
|
958
|
+
brandColor: "#2740B4",
|
|
262
959
|
});
|
|
263
960
|
|
|
264
961
|
// Get current colors
|
|
265
962
|
const colors = themeService.getCurrentColors();
|
|
266
963
|
```
|
|
267
964
|
|
|
268
|
-
###
|
|
965
|
+
### Default Colors
|
|
269
966
|
|
|
270
|
-
| Type
|
|
271
|
-
|
|
272
|
-
| Brand
|
|
273
|
-
| Primary
|
|
274
|
-
| Secondary
|
|
275
|
-
| Functional | `#006BDF`
|
|
276
|
-
| Utility
|
|
277
|
-
| Neutral
|
|
967
|
+
| Type | Default Value |
|
|
968
|
+
| ---------- | ------------- |
|
|
969
|
+
| Brand | `#2740B4` |
|
|
970
|
+
| Primary | `#006BDF` |
|
|
971
|
+
| Secondary | `#9F5100` |
|
|
972
|
+
| Functional | `#006BDF` |
|
|
973
|
+
| Utility | `#CF0026` |
|
|
974
|
+
| Neutral | `#505A5F` |
|
|
278
975
|
|
|
279
|
-
###
|
|
976
|
+
### License
|
|
280
977
|
|
|
281
978
|
MIT License
|
|
282
979
|
|
|
@@ -284,11 +981,34 @@ MIT License
|
|
|
284
981
|
|
|
285
982
|
## Tiếng Việt
|
|
286
983
|
|
|
287
|
-
###
|
|
984
|
+
### Mục lục
|
|
985
|
+
|
|
986
|
+
- [Tổng quan](#tổng-quan)
|
|
987
|
+
- [Tính năng chính](#tính-năng-chính)
|
|
988
|
+
- [Cài đặt](#cài-đặt)
|
|
989
|
+
- [Bắt đầu nhanh](#bắt-đầu-nhanh)
|
|
990
|
+
- [Sử dụng](#sử-dụng)
|
|
991
|
+
- [Hệ thống Icon (DSI)](#hệ-thống-icon-dsi)
|
|
992
|
+
- [Danh sách Icons](#danh-sách-icons)
|
|
993
|
+
- [Cách sử dụng Icon cơ bản](#cách-sử-dụng-icon-cơ-bản)
|
|
994
|
+
- [Màu sắc Icon](#màu-sắc-icon)
|
|
995
|
+
- [Kích thước Icon](#kích-thước-icon)
|
|
996
|
+
- [Animation Icon](#animation-icon)
|
|
997
|
+
- [Ví dụ thực tế](#ví-dụ-thực-tế)
|
|
998
|
+
- [Bảng màu](#bảng-màu)
|
|
999
|
+
- [Semantic Classes](#semantic-classes)
|
|
1000
|
+
- [Màu Badge Theme](#màu-badge-theme)
|
|
1001
|
+
- [Tiện ích kích thước](#tiện-ích-kích-thước)
|
|
1002
|
+
- [Tham chiếu API](#tham-chiếu-api)
|
|
1003
|
+
- [Màu mặc định](#màu-mặc-định)
|
|
1004
|
+
|
|
1005
|
+
---
|
|
1006
|
+
|
|
1007
|
+
### Tổng quan
|
|
288
1008
|
|
|
289
1009
|
**Dynamic-DS (Dynamic Design System)** là thư viện Angular cung cấp hệ thống thiết kế toàn diện với khả năng tùy chỉnh theme động. Nó cho phép ứng dụng tùy chỉnh màu thương hiệu trong khi vẫn duy trì ngôn ngữ thiết kế nhất quán trên tất cả các component.
|
|
290
1010
|
|
|
291
|
-
###
|
|
1011
|
+
### Tính năng chính
|
|
292
1012
|
|
|
293
1013
|
- **Theme màu động**: Tùy chỉnh màu brand, primary, secondary, functional và utility
|
|
294
1014
|
- **Tự động tạo bảng màu**: Tạo 14 sắc độ màu (900-10) từ một màu cơ sở
|
|
@@ -298,13 +1018,13 @@ MIT License
|
|
|
298
1018
|
- **RGB Mix Algorithm**: Tạo sắc độ màu chính xác bằng thuật toán pha trộn RGB
|
|
299
1019
|
- **Cập nhật màu Runtime**: Thay đổi màu theme động mà không cần tải lại trang
|
|
300
1020
|
|
|
301
|
-
###
|
|
1021
|
+
### Cài đặt
|
|
302
1022
|
|
|
303
1023
|
```bash
|
|
304
1024
|
npm install dynamic-ds
|
|
305
1025
|
```
|
|
306
1026
|
|
|
307
|
-
###
|
|
1027
|
+
### Bắt đầu nhanh
|
|
308
1028
|
|
|
309
1029
|
#### 1. Import Styles
|
|
310
1030
|
|
|
@@ -312,9 +1032,7 @@ Thêm styles của design system vào `angular.json`:
|
|
|
312
1032
|
|
|
313
1033
|
```json
|
|
314
1034
|
{
|
|
315
|
-
"styles": [
|
|
316
|
-
"node_modules/dynamic-ds/styles/system-design.scss"
|
|
317
|
-
]
|
|
1035
|
+
"styles": ["node_modules/dynamic-ds/styles/system-design.scss"]
|
|
318
1036
|
}
|
|
319
1037
|
```
|
|
320
1038
|
|
|
@@ -323,22 +1041,22 @@ Thêm styles của design system vào `angular.json`:
|
|
|
323
1041
|
Trong `app.config.ts` hoặc module:
|
|
324
1042
|
|
|
325
1043
|
```typescript
|
|
326
|
-
import { ApplicationConfig } from
|
|
327
|
-
import { SYSTEM_DESIGN_CONFIG } from
|
|
1044
|
+
import { ApplicationConfig } from "@angular/core";
|
|
1045
|
+
import { SYSTEM_DESIGN_CONFIG } from "dynamic-ds";
|
|
328
1046
|
|
|
329
1047
|
export const appConfig: ApplicationConfig = {
|
|
330
1048
|
providers: [
|
|
331
1049
|
{
|
|
332
1050
|
provide: SYSTEM_DESIGN_CONFIG,
|
|
333
1051
|
useValue: {
|
|
334
|
-
brand:
|
|
335
|
-
primary:
|
|
336
|
-
secondary:
|
|
337
|
-
functional:
|
|
338
|
-
utility:
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
]
|
|
1052
|
+
brand: "#2740B4",
|
|
1053
|
+
primary: "#006BDF",
|
|
1054
|
+
secondary: "#9F5100",
|
|
1055
|
+
functional: "#006BDF",
|
|
1056
|
+
utility: "#CF0026",
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
],
|
|
342
1060
|
};
|
|
343
1061
|
```
|
|
344
1062
|
|
|
@@ -347,12 +1065,12 @@ export const appConfig: ApplicationConfig = {
|
|
|
347
1065
|
Trong `app.component.ts`:
|
|
348
1066
|
|
|
349
1067
|
```typescript
|
|
350
|
-
import { Component, inject, OnInit } from
|
|
351
|
-
import { DynamicDsService } from
|
|
1068
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
1069
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
352
1070
|
|
|
353
1071
|
@Component({
|
|
354
|
-
selector:
|
|
355
|
-
template:
|
|
1072
|
+
selector: "app-root",
|
|
1073
|
+
template: `...`,
|
|
356
1074
|
})
|
|
357
1075
|
export class AppComponent implements OnInit {
|
|
358
1076
|
private themeService = inject(DynamicDsService);
|
|
@@ -364,7 +1082,7 @@ export class AppComponent implements OnInit {
|
|
|
364
1082
|
}
|
|
365
1083
|
```
|
|
366
1084
|
|
|
367
|
-
###
|
|
1085
|
+
### Sử dụng
|
|
368
1086
|
|
|
369
1087
|
#### Sử dụng CSS Classes
|
|
370
1088
|
|
|
@@ -404,15 +1122,15 @@ export class AppComponent implements OnInit {
|
|
|
404
1122
|
#### Cập nhật màu động
|
|
405
1123
|
|
|
406
1124
|
```typescript
|
|
407
|
-
import { DynamicDsService } from
|
|
1125
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
408
1126
|
|
|
409
1127
|
export class SettingsComponent {
|
|
410
1128
|
constructor(private themeService: DynamicDsService) {}
|
|
411
1129
|
|
|
412
1130
|
updateTheme() {
|
|
413
1131
|
this.themeService.updateSystemDesignColor({
|
|
414
|
-
primaryColor:
|
|
415
|
-
secondaryColor:
|
|
1132
|
+
primaryColor: "#FF5733",
|
|
1133
|
+
secondaryColor: "#33FF57",
|
|
416
1134
|
});
|
|
417
1135
|
}
|
|
418
1136
|
|
|
@@ -428,70 +1146,224 @@ export class SettingsComponent {
|
|
|
428
1146
|
}
|
|
429
1147
|
```
|
|
430
1148
|
|
|
431
|
-
###
|
|
1149
|
+
### Hệ thống Icon (DSI)
|
|
1150
|
+
|
|
1151
|
+
**Dynamic-DS** bao gồm hệ thống icon mạnh mẽ tương tự Bootstrap Icons, với khả năng tùy chỉnh màu sắc đầy đủ sử dụng kỹ thuật CSS mask.
|
|
1152
|
+
|
|
1153
|
+
#### Danh sách Icons
|
|
1154
|
+
|
|
1155
|
+
Thư viện bao gồm **117 icons** với cả phiên bản line và solid. Xem danh sách đầy đủ trong [phần tiếng Anh](#available-icons).
|
|
1156
|
+
|
|
1157
|
+
#### Cách sử dụng Icon cơ bản
|
|
1158
|
+
|
|
1159
|
+
```html
|
|
1160
|
+
<!-- Icon đơn giản (kích thước mặc định, màu mặc định) -->
|
|
1161
|
+
<i class="dsi dsi-activity-line"></i>
|
|
1162
|
+
|
|
1163
|
+
<!-- Icon với màu từ design system -->
|
|
1164
|
+
<i class="dsi dsi-activity-line dsi-primary-600"></i>
|
|
1165
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-red-600"></i>
|
|
1166
|
+
<i class="dsi dsi-anchor-line dsi-brand-700"></i>
|
|
1167
|
+
|
|
1168
|
+
<!-- Icon với màu tùy chỉnh dùng CSS variable -->
|
|
1169
|
+
<i class="dsi dsi-anchor-line" style="color: var(--primary-600)"></i>
|
|
1170
|
+
<i class="dsi dsi-activity-line" style="color: #FF6B00"></i>
|
|
1171
|
+
|
|
1172
|
+
<!-- Icon với modifier kích thước -->
|
|
1173
|
+
<i class="dsi dsi-activity-line dsi-xs"></i>
|
|
1174
|
+
<!-- Rất nhỏ -->
|
|
1175
|
+
<i class="dsi dsi-activity-line dsi-lg"></i>
|
|
1176
|
+
<!-- Lớn -->
|
|
1177
|
+
<i class="dsi dsi-activity-line dsi-2x"></i>
|
|
1178
|
+
<!-- 2x kích thước -->
|
|
1179
|
+
|
|
1180
|
+
<!-- Icon với animation -->
|
|
1181
|
+
<i class="dsi dsi-activity-line dsi-spin"></i>
|
|
1182
|
+
<!-- Xoay -->
|
|
1183
|
+
<i class="dsi dsi-activity-heart-solid dsi-pulse"></i>
|
|
1184
|
+
<!-- Nhấp nháy -->
|
|
1185
|
+
|
|
1186
|
+
<!-- Kết hợp tất cả -->
|
|
1187
|
+
<i class="dsi dsi-activity-line dsi-primary-600 dsi-2x dsi-spin"></i>
|
|
1188
|
+
```
|
|
1189
|
+
|
|
1190
|
+
#### Màu sắc Icon
|
|
1191
|
+
|
|
1192
|
+
Sử dụng bất kỳ màu nào từ design system:
|
|
1193
|
+
|
|
1194
|
+
```html
|
|
1195
|
+
<!-- Màu dynamic -->
|
|
1196
|
+
<i class="dsi dsi-activity-line dsi-brand-600"></i>
|
|
1197
|
+
<i class="dsi dsi-activity-line dsi-primary-600"></i>
|
|
1198
|
+
<i class="dsi dsi-activity-line dsi-primary-700"></i>
|
|
1199
|
+
<i class="dsi dsi-activity-line dsi-secondary-600"></i>
|
|
1200
|
+
<i class="dsi dsi-activity-line dsi-functional-600"></i>
|
|
1201
|
+
<i class="dsi dsi-activity-line dsi-utility-600"></i>
|
|
1202
|
+
|
|
1203
|
+
<!-- Màu theme -->
|
|
1204
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-red-600"></i>
|
|
1205
|
+
<i class="dsi dsi-anchor-line dsi-theme-blue-600"></i>
|
|
1206
|
+
<i class="dsi dsi-activity-line dsi-theme-green-600"></i>
|
|
1207
|
+
<i class="dsi dsi-activity-line dsi-theme-violet-600"></i>
|
|
1208
|
+
|
|
1209
|
+
<!-- Sắc độ neutral -->
|
|
1210
|
+
<i class="dsi dsi-activity-line dsi-neutral-900"></i>
|
|
1211
|
+
<i class="dsi dsi-activity-line dsi-neutral-600"></i>
|
|
1212
|
+
<i class="dsi dsi-activity-line dsi-neutral-300"></i>
|
|
1213
|
+
|
|
1214
|
+
<!-- Hoặc dùng CSS variables cho màu tùy chỉnh -->
|
|
1215
|
+
<i class="dsi dsi-activity-line" style="color: var(--primary-600)"></i>
|
|
1216
|
+
```
|
|
1217
|
+
|
|
1218
|
+
#### Kích thước Icon
|
|
1219
|
+
|
|
1220
|
+
```html
|
|
1221
|
+
<i class="dsi dsi-activity-line dsi-xs"></i>
|
|
1222
|
+
<!-- 0.75em / 12px -->
|
|
1223
|
+
<i class="dsi dsi-activity-line dsi-sm"></i>
|
|
1224
|
+
<!-- 0.875em / 14px -->
|
|
1225
|
+
<i class="dsi dsi-activity-line"></i>
|
|
1226
|
+
<!-- 1em / 16px (mặc định) -->
|
|
1227
|
+
<i class="dsi dsi-activity-line dsi-lg"></i>
|
|
1228
|
+
<!-- 1.25em / 20px -->
|
|
1229
|
+
<i class="dsi dsi-activity-line dsi-xl"></i>
|
|
1230
|
+
<!-- 1.5em / 24px -->
|
|
1231
|
+
<i class="dsi dsi-activity-line dsi-2x"></i>
|
|
1232
|
+
<!-- 2em / 32px -->
|
|
1233
|
+
<i class="dsi dsi-activity-line dsi-3x"></i>
|
|
1234
|
+
<!-- 3em / 48px -->
|
|
1235
|
+
```
|
|
1236
|
+
|
|
1237
|
+
Icon tự động scale theo font-size, nên chúng tự động thích ứng với kích thước text của container.
|
|
1238
|
+
|
|
1239
|
+
#### Animation Icon
|
|
1240
|
+
|
|
1241
|
+
```html
|
|
1242
|
+
<!-- Animation xoay (360° rotation) -->
|
|
1243
|
+
<i class="dsi dsi-activity-line dsi-spin"></i>
|
|
1244
|
+
|
|
1245
|
+
<!-- Animation nhấp nháy (opacity fade) -->
|
|
1246
|
+
<i class="dsi dsi-activity-heart-solid dsi-pulse"></i>
|
|
1247
|
+
|
|
1248
|
+
<!-- Kết hợp với màu và kích thước -->
|
|
1249
|
+
<i class="dsi dsi-activity-line dsi-primary-600 dsi-2x dsi-spin"></i>
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1252
|
+
#### Ví dụ thực tế
|
|
1253
|
+
|
|
1254
|
+
```html
|
|
1255
|
+
<!-- Button với icon -->
|
|
1256
|
+
<button class="btn btn-primary">
|
|
1257
|
+
<i class="dsi dsi-activity-heart-solid"></i>
|
|
1258
|
+
Thích
|
|
1259
|
+
</button>
|
|
1260
|
+
|
|
1261
|
+
<!-- Trạng thái loading -->
|
|
1262
|
+
<div class="loading">
|
|
1263
|
+
<i class="dsi dsi-activity-line dsi-spin dsi-primary-600 dsi-lg"></i>
|
|
1264
|
+
<span>Đang tải...</span>
|
|
1265
|
+
</div>
|
|
1266
|
+
|
|
1267
|
+
<!-- Alert thành công -->
|
|
1268
|
+
<div class="alert alert-success">
|
|
1269
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-green-600 dsi-xl"></i>
|
|
1270
|
+
<span>Thao tác hoàn tất thành công!</span>
|
|
1271
|
+
</div>
|
|
1272
|
+
|
|
1273
|
+
<!-- Alert lỗi -->
|
|
1274
|
+
<div class="alert alert-error">
|
|
1275
|
+
<i class="dsi dsi-anchor-solid dsi-theme-red-600 dsi-xl"></i>
|
|
1276
|
+
<span>Kết nối thất bại. Vui lòng thử lại.</span>
|
|
1277
|
+
</div>
|
|
1278
|
+
|
|
1279
|
+
<!-- Navigation item với icon -->
|
|
1280
|
+
<a href="/dashboard" class="nav-item">
|
|
1281
|
+
<i class="dsi dsi-activity-line dsi-neutral-600"></i>
|
|
1282
|
+
<span>Bảng điều khiển</span>
|
|
1283
|
+
</a>
|
|
1284
|
+
|
|
1285
|
+
<!-- Chỉ báo trạng thái -->
|
|
1286
|
+
<div class="status">
|
|
1287
|
+
<i class="dsi dsi-activity-heart-solid dsi-theme-green-600 dsi-pulse"></i>
|
|
1288
|
+
<span>Trực tuyến</span>
|
|
1289
|
+
</div>
|
|
1290
|
+
|
|
1291
|
+
<!-- Icon trong heading -->
|
|
1292
|
+
<h2>
|
|
1293
|
+
<i class="dsi dsi-anchor-line dsi-primary-600"></i>
|
|
1294
|
+
Tài liệu
|
|
1295
|
+
</h2>
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
### Bảng màu
|
|
432
1299
|
|
|
433
1300
|
Mỗi loại màu tạo ra 14 sắc độ:
|
|
434
1301
|
|
|
435
|
-
| Sắc độ | Cách dùng
|
|
436
|
-
|
|
437
|
-
| 900
|
|
438
|
-
| 875
|
|
439
|
-
| 850
|
|
440
|
-
| 800
|
|
441
|
-
| 700
|
|
442
|
-
| 600
|
|
443
|
-
| 500
|
|
444
|
-
| 400
|
|
445
|
-
| 300
|
|
446
|
-
| 200
|
|
447
|
-
| 100
|
|
448
|
-
| 50
|
|
449
|
-
| 25
|
|
450
|
-
| 10
|
|
451
|
-
|
|
452
|
-
###
|
|
1302
|
+
| Sắc độ | Cách dùng | Tỷ lệ pha trộn |
|
|
1303
|
+
| ------ | ----------- | -------------- |
|
|
1304
|
+
| 900 | Tối nhất | -73.5% đen |
|
|
1305
|
+
| 875 | Rất tối | -62.5% đen |
|
|
1306
|
+
| 850 | Tối hơn | -47.0% đen |
|
|
1307
|
+
| 800 | Tối | -34.5% đen |
|
|
1308
|
+
| 700 | Tối vừa | -18.5% đen |
|
|
1309
|
+
| 600 | **Màu gốc** | 0% |
|
|
1310
|
+
| 500 | Sáng vừa | +17.5% trắng |
|
|
1311
|
+
| 400 | Sáng | +33.0% trắng |
|
|
1312
|
+
| 300 | Sáng hơn | +53.0% trắng |
|
|
1313
|
+
| 200 | Rất sáng | +72.0% trắng |
|
|
1314
|
+
| 100 | Cực sáng | +85.0% trắng |
|
|
1315
|
+
| 50 | Canvas | +89.5% trắng |
|
|
1316
|
+
| 25 | Mềm | +93.5% trắng |
|
|
1317
|
+
| 10 | Sáng nhất | +97.0% trắng |
|
|
1318
|
+
|
|
1319
|
+
### Semantic Classes
|
|
453
1320
|
|
|
454
1321
|
#### Backgrounds (Nền)
|
|
1322
|
+
|
|
455
1323
|
- `.bg-{type}-canvas` - Nền sáng nhất
|
|
456
1324
|
- `.bg-{type}-soft` - Nền mềm
|
|
457
1325
|
- `.bg-{type}-sub` - Nền tinh tế
|
|
458
1326
|
- `.bg-{type}-accent` - Nền nhấn/chính
|
|
459
1327
|
|
|
460
1328
|
#### Text (Chữ)
|
|
1329
|
+
|
|
461
1330
|
- `.text-{type}-soft` - Màu chữ mềm
|
|
462
1331
|
- `.text-{type}-sub` - Màu chữ tinh tế
|
|
463
1332
|
- `.text-{type}-strong` - Màu chữ đậm/mạnh
|
|
464
1333
|
- `.text-{type}-white` - Chữ trắng
|
|
465
1334
|
|
|
466
1335
|
#### Strokes (Viền)
|
|
1336
|
+
|
|
467
1337
|
- `.stroke-{type}-soft` - Viền mềm
|
|
468
1338
|
- `.stroke-{type}-sub` - Viền tinh tế
|
|
469
1339
|
- `.stroke-{type}-strong` - Viền mạnh
|
|
470
1340
|
- `.stroke-{type}-strong-alpha` - Viền độ mờ 50%
|
|
471
1341
|
|
|
472
1342
|
#### Icons
|
|
1343
|
+
|
|
473
1344
|
- `.icon-{type}-soft` - Màu icon mềm
|
|
474
1345
|
- `.icon-{type}-sub` - Màu icon tinh tế
|
|
475
1346
|
- `.icon-{type}-strong` - Màu icon mạnh
|
|
476
1347
|
- `.icon-{type}-white` - Icon trắng
|
|
477
1348
|
|
|
478
|
-
|
|
1349
|
+
_Trong đó `{type}` có thể là: `brand`, `primary`, `secondary`, `functional`, `utility`, `neutral`, hoặc các theme badge như `red`, `blue`, `green`, v.v._
|
|
479
1350
|
|
|
480
|
-
###
|
|
1351
|
+
### Màu Badge Theme
|
|
481
1352
|
|
|
482
1353
|
Các theme màu định sẵn cho badge/tag:
|
|
1354
|
+
|
|
483
1355
|
- `neutral`, `neutral-light`
|
|
484
1356
|
- `red`, `orange`, `yellow`
|
|
485
1357
|
- `lime`, `green`, `ocean`
|
|
486
1358
|
- `blue`, `indigo`, `violet`, `pink`
|
|
487
1359
|
|
|
488
1360
|
Ví dụ:
|
|
1361
|
+
|
|
489
1362
|
```html
|
|
490
|
-
<span class="bg-blue-soft text-blue-strong stroke-blue-sub">Badge xanh</span>
|
|
491
|
-
<span class="bg-green-canvas text-green-strong">Thành công</span>
|
|
1363
|
+
<span class="bg-blue-soft text-blue-strong stroke-blue-sub">Badge xanh</span> <span class="bg-green-canvas text-green-strong">Thành công</span>
|
|
492
1364
|
```
|
|
493
1365
|
|
|
494
|
-
###
|
|
1366
|
+
### Tiện ích kích thước
|
|
495
1367
|
|
|
496
1368
|
```html
|
|
497
1369
|
<!-- Chiều cao -->
|
|
@@ -516,7 +1388,7 @@ Ví dụ:
|
|
|
516
1388
|
<div class="rounded-full">Bo góc 999px</div>
|
|
517
1389
|
```
|
|
518
1390
|
|
|
519
|
-
###
|
|
1391
|
+
### Tham chiếu API
|
|
520
1392
|
|
|
521
1393
|
#### DynamicDsService
|
|
522
1394
|
|
|
@@ -529,27 +1401,28 @@ Ví dụ:
|
|
|
529
1401
|
- `resetToDefaults(): void` - Đặt lại tất cả màu về giá trị mặc định
|
|
530
1402
|
|
|
531
1403
|
**Ví dụ:**
|
|
1404
|
+
|
|
532
1405
|
```typescript
|
|
533
1406
|
// Khởi tạo khi app start
|
|
534
1407
|
themeService.initializeTheme().subscribe();
|
|
535
1408
|
|
|
536
1409
|
// Cập nhật màu sau đó
|
|
537
1410
|
themeService.updateSystemDesignColor({
|
|
538
|
-
primaryColor:
|
|
539
|
-
brandColor:
|
|
1411
|
+
primaryColor: "#FF6B00",
|
|
1412
|
+
brandColor: "#2740B4",
|
|
540
1413
|
});
|
|
541
1414
|
|
|
542
1415
|
// Lấy màu hiện tại
|
|
543
1416
|
const colors = themeService.getCurrentColors();
|
|
544
1417
|
```
|
|
545
1418
|
|
|
546
|
-
###
|
|
1419
|
+
### Màu mặc định
|
|
547
1420
|
|
|
548
|
-
| Loại
|
|
549
|
-
|
|
550
|
-
| Brand
|
|
551
|
-
| Primary
|
|
552
|
-
| Secondary
|
|
553
|
-
| Functional | `#006BDF`
|
|
554
|
-
| Utility
|
|
555
|
-
| Neutral
|
|
1421
|
+
| Loại | Giá trị mặc định |
|
|
1422
|
+
| ---------- | ---------------- |
|
|
1423
|
+
| Brand | `#2740B4` |
|
|
1424
|
+
| Primary | `#006BDF` |
|
|
1425
|
+
| Secondary | `#9F5100` |
|
|
1426
|
+
| Functional | `#006BDF` |
|
|
1427
|
+
| Utility | `#CF0026` |
|
|
1428
|
+
| Neutral | `#505A5F` |
|