dynamic-ds 1.0.2 → 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 +1036 -196
- package/fesm2022/dynamic-ds.mjs +6 -9
- package/fesm2022/dynamic-ds.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/styles/icons.scss +1791 -0
- package/src/lib/styles/system-design.scss +325 -137
package/README.md
CHANGED
|
@@ -1,66 +1,134 @@
|
|
|
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
|
|
62
|
+
|
|
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>
|
|
67
|
+
|
|
68
|
+
Add the design system styles to your `angular.json`:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
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
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or import directly in your `styles.scss`:
|
|
30
87
|
|
|
31
|
-
|
|
88
|
+
```scss
|
|
89
|
+
@import "dynamic-ds/styles/system-design.scss";
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
</details>
|
|
93
|
+
|
|
94
|
+
<details open>
|
|
95
|
+
<summary><strong>Step 2: Configure Theme Colors (Optional)</strong></summary>
|
|
96
|
+
|
|
97
|
+
#### For Module-based Apps
|
|
32
98
|
|
|
33
99
|
In your `app.module.ts`:
|
|
34
100
|
|
|
35
101
|
```typescript
|
|
36
|
-
import { NgModule } from
|
|
37
|
-
import { BrowserModule } from
|
|
38
|
-
import { DynamicDsModule } from
|
|
39
|
-
import { AppComponent } from
|
|
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";
|
|
40
106
|
|
|
41
107
|
@NgModule({
|
|
42
108
|
declarations: [AppComponent],
|
|
43
109
|
imports: [
|
|
44
110
|
BrowserModule,
|
|
45
111
|
DynamicDsModule.forRoot({
|
|
46
|
-
brand:
|
|
47
|
-
primary:
|
|
48
|
-
secondary:
|
|
49
|
-
functional:
|
|
50
|
-
utility:
|
|
51
|
-
})
|
|
112
|
+
brand: "#2740B4",
|
|
113
|
+
primary: "#006BDF",
|
|
114
|
+
secondary: "#9F5100",
|
|
115
|
+
functional: "#006BDF",
|
|
116
|
+
utility: "#CF0026",
|
|
117
|
+
}),
|
|
52
118
|
],
|
|
53
|
-
bootstrap: [AppComponent]
|
|
119
|
+
bootstrap: [AppComponent],
|
|
54
120
|
})
|
|
55
|
-
export class AppModule {
|
|
121
|
+
export class AppModule {}
|
|
56
122
|
```
|
|
57
123
|
|
|
58
|
-
|
|
124
|
+
#### For Standalone Apps (Angular 14+)
|
|
125
|
+
|
|
126
|
+
In your `app.config.ts`:
|
|
59
127
|
|
|
60
128
|
```typescript
|
|
61
|
-
import { ApplicationConfig } from
|
|
62
|
-
import { provideAnimations } from
|
|
63
|
-
import { SYSTEM_DESIGN_CONFIG } from
|
|
129
|
+
import { ApplicationConfig } from "@angular/core";
|
|
130
|
+
import { provideAnimations } from "@angular/platform-browser/animations";
|
|
131
|
+
import { SYSTEM_DESIGN_CONFIG } from "dynamic-ds";
|
|
64
132
|
|
|
65
133
|
export const appConfig: ApplicationConfig = {
|
|
66
134
|
providers: [
|
|
@@ -68,46 +136,60 @@ export const appConfig: ApplicationConfig = {
|
|
|
68
136
|
{
|
|
69
137
|
provide: SYSTEM_DESIGN_CONFIG,
|
|
70
138
|
useValue: {
|
|
71
|
-
brand:
|
|
72
|
-
primary:
|
|
73
|
-
secondary:
|
|
74
|
-
functional:
|
|
75
|
-
utility:
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
]
|
|
139
|
+
brand: "#2740B4",
|
|
140
|
+
primary: "#006BDF",
|
|
141
|
+
secondary: "#9F5100",
|
|
142
|
+
functional: "#006BDF",
|
|
143
|
+
utility: "#CF0026",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
79
147
|
};
|
|
80
148
|
```
|
|
81
149
|
|
|
82
|
-
|
|
150
|
+
</details>
|
|
83
151
|
|
|
84
|
-
|
|
152
|
+
<details open>
|
|
153
|
+
<summary><strong>Step 3: Initialize Theme Service</strong></summary>
|
|
85
154
|
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
"styles": [
|
|
89
|
-
"node_modules/dynamic-ds/src/lib/styles/system-design.scss"
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
```
|
|
155
|
+
In your `app.component.ts`:
|
|
93
156
|
|
|
94
|
-
|
|
157
|
+
```typescript
|
|
158
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
159
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
95
160
|
|
|
96
|
-
|
|
97
|
-
|
|
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
|
+
}
|
|
98
178
|
```
|
|
99
179
|
|
|
100
|
-
|
|
180
|
+
</details>
|
|
181
|
+
|
|
182
|
+
**That's it!** You're ready to use Dynamic-DS components and utilities.
|
|
101
183
|
|
|
102
184
|
In your `app.component.ts`:
|
|
103
185
|
|
|
104
186
|
```typescript
|
|
105
|
-
import { Component, inject, OnInit } from
|
|
106
|
-
import { DynamicDsService } from
|
|
187
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
188
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
107
189
|
|
|
108
190
|
@Component({
|
|
109
|
-
selector:
|
|
110
|
-
template:
|
|
191
|
+
selector: "app-root",
|
|
192
|
+
template: `...`,
|
|
111
193
|
})
|
|
112
194
|
export class AppComponent implements OnInit {
|
|
113
195
|
private themeService = inject(DynamicDsService);
|
|
@@ -119,55 +201,150 @@ export class AppComponent implements OnInit {
|
|
|
119
201
|
}
|
|
120
202
|
```
|
|
121
203
|
|
|
122
|
-
###
|
|
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>
|
|
123
210
|
|
|
124
|
-
|
|
211
|
+
The easiest way to apply design system colors:
|
|
125
212
|
|
|
126
213
|
```html
|
|
127
214
|
<!-- Background colors -->
|
|
128
|
-
<div class="bg-primary-canvas">Lightest background</div>
|
|
129
|
-
<div class="bg-primary-soft">Soft background</div>
|
|
130
|
-
<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>
|
|
131
219
|
|
|
132
220
|
<!-- Text colors -->
|
|
133
|
-
<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>
|
|
134
223
|
<p class="text-neutral-soft">Soft neutral text</p>
|
|
224
|
+
<p class="text-neutral-strong">Strong neutral text</p>
|
|
135
225
|
|
|
136
226
|
<!-- Borders -->
|
|
137
|
-
<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:**
|
|
138
236
|
|
|
139
|
-
|
|
140
|
-
|
|
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>
|
|
245
|
+
|
|
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 -->
|
|
141
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>
|
|
142
259
|
```
|
|
143
260
|
|
|
144
|
-
|
|
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:
|
|
145
269
|
|
|
146
270
|
```scss
|
|
147
271
|
.my-component {
|
|
272
|
+
// Basic color usage
|
|
148
273
|
background-color: var(--primary-600);
|
|
149
274
|
color: var(--neutral-900);
|
|
150
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));
|
|
151
284
|
}
|
|
152
285
|
|
|
153
|
-
//
|
|
154
|
-
.
|
|
155
|
-
background-color:
|
|
286
|
+
// Hover states
|
|
287
|
+
.button:hover {
|
|
288
|
+
background-color: var(--primary-700);
|
|
289
|
+
border-color: var(--primary-800);
|
|
156
290
|
}
|
|
157
291
|
```
|
|
158
292
|
|
|
159
|
-
|
|
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:
|
|
160
328
|
|
|
161
329
|
```typescript
|
|
162
|
-
import {
|
|
330
|
+
import { Component, inject } from "@angular/core";
|
|
331
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
163
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
|
+
})
|
|
164
340
|
export class SettingsComponent {
|
|
165
|
-
|
|
341
|
+
private themeService = inject(DynamicDsService);
|
|
166
342
|
|
|
167
343
|
updateTheme() {
|
|
168
344
|
this.themeService.updateSystemDesignColor({
|
|
169
|
-
primaryColor:
|
|
170
|
-
secondaryColor:
|
|
345
|
+
primaryColor: "#FF5733",
|
|
346
|
+
secondaryColor: "#33FF57",
|
|
347
|
+
brandColor: "#9C27B0",
|
|
171
348
|
});
|
|
172
349
|
}
|
|
173
350
|
|
|
@@ -178,75 +355,561 @@ export class SettingsComponent {
|
|
|
178
355
|
getCurrentColors() {
|
|
179
356
|
const colors = this.themeService.getCurrentColors();
|
|
180
357
|
console.log(colors);
|
|
181
|
-
// { brand: '#...', primary: '#...', secondary: '#...', ... }
|
|
358
|
+
// Output: { brand: '#...', primary: '#...', secondary: '#...', ... }
|
|
182
359
|
}
|
|
183
360
|
}
|
|
184
361
|
```
|
|
185
362
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
Each color type generates 14 shades:
|
|
189
|
-
|
|
190
|
-
| Shade | Usage | Mix Ratio |
|
|
191
|
-
|-------|-------|-----------|
|
|
192
|
-
| 900 | Darkest | -73.5% black |
|
|
193
|
-
| 875 | Very dark | -62.5% black |
|
|
194
|
-
| 850 | Darker | -47.0% black |
|
|
195
|
-
| 800 | Dark | -34.5% black |
|
|
196
|
-
| 700 | Medium dark | -18.5% black |
|
|
197
|
-
| 600 | **Base color** | 0% |
|
|
198
|
-
| 500 | Medium light | +17.5% white |
|
|
199
|
-
| 400 | Light | +33.0% white |
|
|
200
|
-
| 300 | Lighter | +53.0% white |
|
|
201
|
-
| 200 | Very light | +72.0% white |
|
|
202
|
-
| 100 | Ultra light | +85.0% white |
|
|
203
|
-
| 50 | Canvas | +89.5% white |
|
|
204
|
-
| 25 | Soft | +93.5% white |
|
|
205
|
-
| 10 | Lightest | +97.0% white |
|
|
206
|
-
|
|
207
|
-
### 🏷️ Semantic Classes
|
|
208
|
-
|
|
209
|
-
#### Backgrounds
|
|
210
|
-
- `.bg-{type}-canvas` - Lightest background
|
|
211
|
-
- `.bg-{type}-soft` - Soft background
|
|
212
|
-
- `.bg-{type}-sub` - Subtle background
|
|
213
|
-
- `.bg-{type}-accent` - Accent/primary background
|
|
214
|
-
|
|
215
|
-
#### Text
|
|
216
|
-
- `.text-{type}-soft` - Soft text color
|
|
217
|
-
- `.text-{type}-sub` - Subtle text color
|
|
218
|
-
- `.text-{type}-strong` - Strong/bold text color
|
|
219
|
-
- `.text-{type}-white` - White text
|
|
220
|
-
|
|
221
|
-
#### Strokes (Borders)
|
|
222
|
-
- `.stroke-{type}-soft` - Soft border
|
|
223
|
-
- `.stroke-{type}-sub` - Subtle border
|
|
224
|
-
- `.stroke-{type}-strong` - Strong border
|
|
225
|
-
- `.stroke-{type}-strong-alpha` - 50% opacity border
|
|
363
|
+
</details>
|
|
226
364
|
|
|
227
|
-
|
|
228
|
-
- `.icon-{type}-soft` - Soft icon color
|
|
229
|
-
- `.icon-{type}-sub` - Subtle icon color
|
|
230
|
-
- `.icon-{type}-strong` - Strong icon color
|
|
231
|
-
- `.icon-{type}-white` - White icon
|
|
365
|
+
---
|
|
232
366
|
|
|
233
|
-
|
|
367
|
+
### Icon System (DSI)
|
|
234
368
|
|
|
235
|
-
|
|
369
|
+
**Dynamic-DS** includes a powerful icon system similar to Bootstrap Icons, with full color customization support using CSS mask technique.
|
|
236
370
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- `red`, `orange`, `yellow`
|
|
240
|
-
- `lime`, `green`, `ocean`
|
|
241
|
-
- `blue`, `indigo`, `violet`, `pink`
|
|
371
|
+
<details open>
|
|
372
|
+
<summary><strong>Basic Icon Usage</strong></summary>
|
|
242
373
|
|
|
243
|
-
Example:
|
|
244
374
|
```html
|
|
245
|
-
|
|
246
|
-
<
|
|
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>
|
|
247
403
|
```
|
|
248
404
|
|
|
249
|
-
|
|
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
|
|
250
913
|
|
|
251
914
|
```html
|
|
252
915
|
<!-- Heights -->
|
|
@@ -271,7 +934,7 @@ Example:
|
|
|
271
934
|
<div class="rounded-full">999px radius</div>
|
|
272
935
|
```
|
|
273
936
|
|
|
274
|
-
###
|
|
937
|
+
### API Reference
|
|
275
938
|
|
|
276
939
|
#### DynamicDsService
|
|
277
940
|
|
|
@@ -284,32 +947,33 @@ Example:
|
|
|
284
947
|
- `resetToDefaults(): void` - Reset all colors to default values
|
|
285
948
|
|
|
286
949
|
**Example:**
|
|
950
|
+
|
|
287
951
|
```typescript
|
|
288
952
|
// Initialize on app start
|
|
289
953
|
themeService.initializeTheme().subscribe();
|
|
290
954
|
|
|
291
955
|
// Update colors later
|
|
292
956
|
themeService.updateSystemDesignColor({
|
|
293
|
-
primaryColor:
|
|
294
|
-
brandColor:
|
|
957
|
+
primaryColor: "#FF6B00",
|
|
958
|
+
brandColor: "#2740B4",
|
|
295
959
|
});
|
|
296
960
|
|
|
297
961
|
// Get current colors
|
|
298
962
|
const colors = themeService.getCurrentColors();
|
|
299
963
|
```
|
|
300
964
|
|
|
301
|
-
###
|
|
965
|
+
### Default Colors
|
|
302
966
|
|
|
303
|
-
| Type
|
|
304
|
-
|
|
305
|
-
| Brand
|
|
306
|
-
| Primary
|
|
307
|
-
| Secondary
|
|
308
|
-
| Functional | `#006BDF`
|
|
309
|
-
| Utility
|
|
310
|
-
| Neutral
|
|
967
|
+
| Type | Default Value |
|
|
968
|
+
| ---------- | ------------- |
|
|
969
|
+
| Brand | `#2740B4` |
|
|
970
|
+
| Primary | `#006BDF` |
|
|
971
|
+
| Secondary | `#9F5100` |
|
|
972
|
+
| Functional | `#006BDF` |
|
|
973
|
+
| Utility | `#CF0026` |
|
|
974
|
+
| Neutral | `#505A5F` |
|
|
311
975
|
|
|
312
|
-
###
|
|
976
|
+
### License
|
|
313
977
|
|
|
314
978
|
MIT License
|
|
315
979
|
|
|
@@ -317,11 +981,34 @@ MIT License
|
|
|
317
981
|
|
|
318
982
|
## Tiếng Việt
|
|
319
983
|
|
|
320
|
-
###
|
|
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
|
|
321
1008
|
|
|
322
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.
|
|
323
1010
|
|
|
324
|
-
###
|
|
1011
|
+
### Tính năng chính
|
|
325
1012
|
|
|
326
1013
|
- **Theme màu động**: Tùy chỉnh màu brand, primary, secondary, functional và utility
|
|
327
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ở
|
|
@@ -331,13 +1018,13 @@ MIT License
|
|
|
331
1018
|
- **RGB Mix Algorithm**: Tạo sắc độ màu chính xác bằng thuật toán pha trộn RGB
|
|
332
1019
|
- **Cập nhật màu Runtime**: Thay đổi màu theme động mà không cần tải lại trang
|
|
333
1020
|
|
|
334
|
-
###
|
|
1021
|
+
### Cài đặt
|
|
335
1022
|
|
|
336
1023
|
```bash
|
|
337
1024
|
npm install dynamic-ds
|
|
338
1025
|
```
|
|
339
1026
|
|
|
340
|
-
###
|
|
1027
|
+
### Bắt đầu nhanh
|
|
341
1028
|
|
|
342
1029
|
#### 1. Import Styles
|
|
343
1030
|
|
|
@@ -345,9 +1032,7 @@ Thêm styles của design system vào `angular.json`:
|
|
|
345
1032
|
|
|
346
1033
|
```json
|
|
347
1034
|
{
|
|
348
|
-
"styles": [
|
|
349
|
-
"node_modules/dynamic-ds/styles/system-design.scss"
|
|
350
|
-
]
|
|
1035
|
+
"styles": ["node_modules/dynamic-ds/styles/system-design.scss"]
|
|
351
1036
|
}
|
|
352
1037
|
```
|
|
353
1038
|
|
|
@@ -356,22 +1041,22 @@ Thêm styles của design system vào `angular.json`:
|
|
|
356
1041
|
Trong `app.config.ts` hoặc module:
|
|
357
1042
|
|
|
358
1043
|
```typescript
|
|
359
|
-
import { ApplicationConfig } from
|
|
360
|
-
import { SYSTEM_DESIGN_CONFIG } from
|
|
1044
|
+
import { ApplicationConfig } from "@angular/core";
|
|
1045
|
+
import { SYSTEM_DESIGN_CONFIG } from "dynamic-ds";
|
|
361
1046
|
|
|
362
1047
|
export const appConfig: ApplicationConfig = {
|
|
363
1048
|
providers: [
|
|
364
1049
|
{
|
|
365
1050
|
provide: SYSTEM_DESIGN_CONFIG,
|
|
366
1051
|
useValue: {
|
|
367
|
-
brand:
|
|
368
|
-
primary:
|
|
369
|
-
secondary:
|
|
370
|
-
functional:
|
|
371
|
-
utility:
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
]
|
|
1052
|
+
brand: "#2740B4",
|
|
1053
|
+
primary: "#006BDF",
|
|
1054
|
+
secondary: "#9F5100",
|
|
1055
|
+
functional: "#006BDF",
|
|
1056
|
+
utility: "#CF0026",
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
],
|
|
375
1060
|
};
|
|
376
1061
|
```
|
|
377
1062
|
|
|
@@ -380,12 +1065,12 @@ export const appConfig: ApplicationConfig = {
|
|
|
380
1065
|
Trong `app.component.ts`:
|
|
381
1066
|
|
|
382
1067
|
```typescript
|
|
383
|
-
import { Component, inject, OnInit } from
|
|
384
|
-
import { DynamicDsService } from
|
|
1068
|
+
import { Component, inject, OnInit } from "@angular/core";
|
|
1069
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
385
1070
|
|
|
386
1071
|
@Component({
|
|
387
|
-
selector:
|
|
388
|
-
template:
|
|
1072
|
+
selector: "app-root",
|
|
1073
|
+
template: `...`,
|
|
389
1074
|
})
|
|
390
1075
|
export class AppComponent implements OnInit {
|
|
391
1076
|
private themeService = inject(DynamicDsService);
|
|
@@ -397,7 +1082,7 @@ export class AppComponent implements OnInit {
|
|
|
397
1082
|
}
|
|
398
1083
|
```
|
|
399
1084
|
|
|
400
|
-
###
|
|
1085
|
+
### Sử dụng
|
|
401
1086
|
|
|
402
1087
|
#### Sử dụng CSS Classes
|
|
403
1088
|
|
|
@@ -437,15 +1122,15 @@ export class AppComponent implements OnInit {
|
|
|
437
1122
|
#### Cập nhật màu động
|
|
438
1123
|
|
|
439
1124
|
```typescript
|
|
440
|
-
import { DynamicDsService } from
|
|
1125
|
+
import { DynamicDsService } from "dynamic-ds";
|
|
441
1126
|
|
|
442
1127
|
export class SettingsComponent {
|
|
443
1128
|
constructor(private themeService: DynamicDsService) {}
|
|
444
1129
|
|
|
445
1130
|
updateTheme() {
|
|
446
1131
|
this.themeService.updateSystemDesignColor({
|
|
447
|
-
primaryColor:
|
|
448
|
-
secondaryColor:
|
|
1132
|
+
primaryColor: "#FF5733",
|
|
1133
|
+
secondaryColor: "#33FF57",
|
|
449
1134
|
});
|
|
450
1135
|
}
|
|
451
1136
|
|
|
@@ -461,70 +1146,224 @@ export class SettingsComponent {
|
|
|
461
1146
|
}
|
|
462
1147
|
```
|
|
463
1148
|
|
|
464
|
-
###
|
|
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
|
|
465
1299
|
|
|
466
1300
|
Mỗi loại màu tạo ra 14 sắc độ:
|
|
467
1301
|
|
|
468
|
-
| Sắc độ | Cách dùng
|
|
469
|
-
|
|
470
|
-
| 900
|
|
471
|
-
| 875
|
|
472
|
-
| 850
|
|
473
|
-
| 800
|
|
474
|
-
| 700
|
|
475
|
-
| 600
|
|
476
|
-
| 500
|
|
477
|
-
| 400
|
|
478
|
-
| 300
|
|
479
|
-
| 200
|
|
480
|
-
| 100
|
|
481
|
-
| 50
|
|
482
|
-
| 25
|
|
483
|
-
| 10
|
|
484
|
-
|
|
485
|
-
###
|
|
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
|
|
486
1320
|
|
|
487
1321
|
#### Backgrounds (Nền)
|
|
1322
|
+
|
|
488
1323
|
- `.bg-{type}-canvas` - Nền sáng nhất
|
|
489
1324
|
- `.bg-{type}-soft` - Nền mềm
|
|
490
1325
|
- `.bg-{type}-sub` - Nền tinh tế
|
|
491
1326
|
- `.bg-{type}-accent` - Nền nhấn/chính
|
|
492
1327
|
|
|
493
1328
|
#### Text (Chữ)
|
|
1329
|
+
|
|
494
1330
|
- `.text-{type}-soft` - Màu chữ mềm
|
|
495
1331
|
- `.text-{type}-sub` - Màu chữ tinh tế
|
|
496
1332
|
- `.text-{type}-strong` - Màu chữ đậm/mạnh
|
|
497
1333
|
- `.text-{type}-white` - Chữ trắng
|
|
498
1334
|
|
|
499
1335
|
#### Strokes (Viền)
|
|
1336
|
+
|
|
500
1337
|
- `.stroke-{type}-soft` - Viền mềm
|
|
501
1338
|
- `.stroke-{type}-sub` - Viền tinh tế
|
|
502
1339
|
- `.stroke-{type}-strong` - Viền mạnh
|
|
503
1340
|
- `.stroke-{type}-strong-alpha` - Viền độ mờ 50%
|
|
504
1341
|
|
|
505
1342
|
#### Icons
|
|
1343
|
+
|
|
506
1344
|
- `.icon-{type}-soft` - Màu icon mềm
|
|
507
1345
|
- `.icon-{type}-sub` - Màu icon tinh tế
|
|
508
1346
|
- `.icon-{type}-strong` - Màu icon mạnh
|
|
509
1347
|
- `.icon-{type}-white` - Icon trắng
|
|
510
1348
|
|
|
511
|
-
|
|
1349
|
+
_Trong đó `{type}` có thể là: `brand`, `primary`, `secondary`, `functional`, `utility`, `neutral`, hoặc các theme badge như `red`, `blue`, `green`, v.v._
|
|
512
1350
|
|
|
513
|
-
###
|
|
1351
|
+
### Màu Badge Theme
|
|
514
1352
|
|
|
515
1353
|
Các theme màu định sẵn cho badge/tag:
|
|
1354
|
+
|
|
516
1355
|
- `neutral`, `neutral-light`
|
|
517
1356
|
- `red`, `orange`, `yellow`
|
|
518
1357
|
- `lime`, `green`, `ocean`
|
|
519
1358
|
- `blue`, `indigo`, `violet`, `pink`
|
|
520
1359
|
|
|
521
1360
|
Ví dụ:
|
|
1361
|
+
|
|
522
1362
|
```html
|
|
523
|
-
<span class="bg-blue-soft text-blue-strong stroke-blue-sub">Badge xanh</span>
|
|
524
|
-
<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>
|
|
525
1364
|
```
|
|
526
1365
|
|
|
527
|
-
###
|
|
1366
|
+
### Tiện ích kích thước
|
|
528
1367
|
|
|
529
1368
|
```html
|
|
530
1369
|
<!-- Chiều cao -->
|
|
@@ -549,7 +1388,7 @@ Ví dụ:
|
|
|
549
1388
|
<div class="rounded-full">Bo góc 999px</div>
|
|
550
1389
|
```
|
|
551
1390
|
|
|
552
|
-
###
|
|
1391
|
+
### Tham chiếu API
|
|
553
1392
|
|
|
554
1393
|
#### DynamicDsService
|
|
555
1394
|
|
|
@@ -562,27 +1401,28 @@ Ví dụ:
|
|
|
562
1401
|
- `resetToDefaults(): void` - Đặt lại tất cả màu về giá trị mặc định
|
|
563
1402
|
|
|
564
1403
|
**Ví dụ:**
|
|
1404
|
+
|
|
565
1405
|
```typescript
|
|
566
1406
|
// Khởi tạo khi app start
|
|
567
1407
|
themeService.initializeTheme().subscribe();
|
|
568
1408
|
|
|
569
1409
|
// Cập nhật màu sau đó
|
|
570
1410
|
themeService.updateSystemDesignColor({
|
|
571
|
-
primaryColor:
|
|
572
|
-
brandColor:
|
|
1411
|
+
primaryColor: "#FF6B00",
|
|
1412
|
+
brandColor: "#2740B4",
|
|
573
1413
|
});
|
|
574
1414
|
|
|
575
1415
|
// Lấy màu hiện tại
|
|
576
1416
|
const colors = themeService.getCurrentColors();
|
|
577
1417
|
```
|
|
578
1418
|
|
|
579
|
-
###
|
|
1419
|
+
### Màu mặc định
|
|
580
1420
|
|
|
581
|
-
| Loại
|
|
582
|
-
|
|
583
|
-
| Brand
|
|
584
|
-
| Primary
|
|
585
|
-
| Secondary
|
|
586
|
-
| Functional | `#006BDF`
|
|
587
|
-
| Utility
|
|
588
|
-
| 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` |
|