You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/components/button.md
+35-14Lines changed: 35 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,25 @@ If all went well, you should see something like the following in the browser:
249
249
250
250
## Styling
251
251
252
-
To get started with styling the button, we need to import the `index` file, where all the theme functions and component mixins live:
252
+
Following the simplest approach, you can use CSS variables to customize the appearance of the button:
253
+
254
+
```css
255
+
[igxButton] {
256
+
--background: #ff4d4f;
257
+
--hover-background: #ff7875;
258
+
--active-background: #d9363e;
259
+
--focus-visible-background: #ff4d4f;
260
+
--focus-visible-foreground: #fff;
261
+
}
262
+
```
263
+
264
+
By changing the values of these CSS variables, you can alter the entire look of the button.
265
+
266
+
<divclass="divider--half"></div>
267
+
268
+
Another way to style the button is by using **Sass**, along with our [`button-theme`]({environment:sassApiUrl}/index.html#function-button-theme) function.
269
+
270
+
To start styling the button using **Sass**, first import the `index` file, which includes all theme functions and component mixins:
253
271
254
272
```scss
255
273
@use"igniteui-angular/theming"as*;
@@ -268,27 +286,27 @@ Given the following markup:
268
286
</div>
269
287
```
270
288
271
-
We need to create a theme:
289
+
We need to create the following theme:
272
290
273
291
```scss
274
292
$custom-button-theme: button-theme(
275
-
$foreground:#fdfdfd,
276
-
$hover-foreground:#fdfdfd,
277
-
$focus-foreground:#fdfdfd,
278
-
$background:#345779,
279
-
$hover-background:#2e4d6b,
280
-
$focus-background:#2e4d6b,
281
-
$disabled-foreground:#2e4d6b,
293
+
$foreground:#fdfdfd,
294
+
$hover-foreground:#fdfdfd,
295
+
$focus-foreground:#fdfdfd,
296
+
$background:#345779,
297
+
$hover-background:#2e4d6b,
298
+
$focus-background:#2e4d6b,
299
+
$disabled-foreground:#2e4d6b,
282
300
);
283
301
```
284
302
285
303
Take a look at the [`button-theme`]({environment:sassApiUrl}/themes#function-button-theme) section for a complete list of available parameters for styling any type of button.
286
304
287
-
The last step is to pass the custom button theme in our application:
305
+
Finally, **include**the custom theme in your application:
288
306
289
307
```scss
290
308
.button-sample {
291
-
@includecss-vars($custom-button-theme);
309
+
@includecss-vars($custom-button-theme);
292
310
}
293
311
```
294
312
@@ -310,22 +328,25 @@ If you want to style only the `contained` button, you can use the [`contained-bu
310
328
311
329
```scss
312
330
$custom-contained-theme: contained-button-theme(
313
-
$background:#348ae0,
331
+
$background:#348ae0,
314
332
);
315
333
```
316
334
317
335
With the new type-specific theme functions, styling buttons is now easier. For [`contained-button-theme`]({environment:sassApiUrl}/themes#function-contained-button-theme) and [`fab-button-theme`]({environment:sassApiUrl}/themes#function-fab-button-theme) functions (as shown in the example above), you only need to provide a color to the `$background` parameter. All other button state and text colors will then be automatically generated and applied based on that value. The text color is determined by the newly added [`adaptive-contrast`]({environment:sassApiUrl}/color#function-adaptive-contrast) function, which calculates whether black or white provides better contrast against the supplied background color.
318
336
319
337
For [`flat-button-theme`]({environment:sassApiUrl}/themes#function-flat-button-theme) and [`outlined-button-theme`]({environment:sassApiUrl}/themes#function-outlined-button-theme) functions, the button state colors are also automatically generated and applied, but they are derived from the supplied `$foreground` parameter instead of `$background`.
320
338
321
-
### Demo
339
+
In the sample below, you can see how using the button component with customized CSS variables allows you to create a design that visually resembles the button used in the [`Ant`](https://ant.design/components/button?theme=light#button-demo-color-variant) design system.
Copy file name to clipboardExpand all lines: en/components/calendar.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -480,13 +480,14 @@ The last step is to pass the custom calendar theme:
480
480
@includecss-vars($custom-calendar-theme);
481
481
```
482
482
483
-
<code-view style="height:500px"
483
+
In the sample below, you can see how using the calendar with customized CSS variables allows you to create a design that visually resembles the calendar used in the [`SAP UI5`](https://ui5.sap.com/#/entity/sap.ui.unified.Calendar/sample/sap.ui.unified.sample.CalendarSingleDaySelection) design system.
Following the simplest approach, we create a new theme that extends the [`card-theme`]({environment:sassApiUrl}/themes#function-card-theme) and providing just a few styling parameters. If you only specify the `$background` parameter, the appropriate foreground colors will be automatically chosen, either black or white, based on which offers better contrast with the background.
340
359
341
360
```scss
342
-
$colorful-card: card-theme(
343
-
$background:#011627,
344
-
$subtitle-text-color:#ecaa53,
361
+
$custom-card-theme: card-theme(
362
+
$background:#011627,
363
+
$subtitle-text-color:#ecaa53,
345
364
);
346
365
```
347
-
As seen, the `card-theme` exposes some useful parameters for basic styling of its items.
348
366
349
-
The last step is to **include** the component theme in our application.
367
+
Finally, **include** the custom theme in your application:
350
368
351
369
```scss
352
-
@includecss-vars($colorful-card);
370
+
@includecss-vars($custom-card-theme);
353
371
```
354
372
355
-
### Angular Card Demo
373
+
In the sample below, you can see how using the card component with customized CSS variables allows you to create a design that visually resembles the card used in the [`Ant`](https://ant.design/components/card?theme=light#card-demo-meta) design system.
In this article we covered a lot of ground with the card component. First, we created a very simple card with text content only. Then added some images to make the card a bit more appealing. We used some additional Ignite UI for Angular components inside our card, avatar, buttons and icons, to enrich the experience and add some functionality. And finally, we changed the card's theme by setting some exposed theme colors, creating custom palettes and extending schemas.
367
384
The card component is capable of displaying more different layouts worth exploring in the Card Demo in the beginning of this article.
Copy file name to clipboardExpand all lines: en/components/checkbox.md
+32-7Lines changed: 32 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,31 @@ After all that is done, our application should look like this:
211
211
212
212
## Styling
213
213
214
-
To get started with styling the checkbox, we need to import the `index` file, where all the theme functions and component mixins live:
214
+
Following the simplest approach, you can use CSS variables to customize the appearance of the checkbox:
215
+
216
+
```css
217
+
igx-checkbox {
218
+
--tick-color: #0064d9;
219
+
--tick-color-hover: #e3f0ff;
220
+
--fill-color: transparent;
221
+
--fill-color-hover: #e3f0ff;
222
+
--label-color: #131e29;
223
+
--focus-outline-color: #0032a5;
224
+
--border-radius: 0.25rem;
225
+
}
226
+
227
+
igx-checkbox:hover {
228
+
--empty-fill-color: #e3f0ff;
229
+
}
230
+
```
231
+
232
+
By changing the values of these CSS variables, you can alter the entire look of the checkbox component.
233
+
234
+
<divclass="divider--half"></div>
235
+
236
+
Another way to style the checkbox is by using **Sass**, along with our [`checkbox-theme`]({environment:sassApiUrl}/index.html#function-checkbox-theme) function.
237
+
238
+
To start styling the checkbox using **Sass**, first import the `index` file, which includes all theme functions and component mixins:
215
239
216
240
```scss
217
241
@use"igniteui-angular/theming"as*;
@@ -225,27 +249,28 @@ Then, we create a new theme that extends the [`checkbox-theme`]({environment:sas
225
249
```scss
226
250
// in styles.scss
227
251
$custom-checkbox-theme: checkbox-theme(
228
-
$empty-color:#ecaa53,
229
-
$fill-color:#ecaa53,
230
-
$border-radius:5px
252
+
$empty-color:#ecaa53,
253
+
$fill-color:#ecaa53,
254
+
$border-radius:5px
231
255
);
232
256
```
233
257
234
-
The last step is to **include** the component theme in our application.
258
+
Finally, **include** the custom theme in your application:
235
259
236
260
```scss
237
261
@includecss-vars($custom-checkbox-theme);
238
262
```
239
263
240
-
### Demo
241
-
264
+
In the sample below, you can see how using the checkbox component with customized CSS variables allows you to create a design that visually resembles the checkbox used in the [`SAP UI5`](https://ui5.sap.com/#/entity/sap.m.CheckBox/sample/sap.m.sample.CheckBox) design system.
Copy file name to clipboardExpand all lines: en/components/chip.md
+25-9Lines changed: 25 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -480,7 +480,23 @@ If everything's set up correctly, you should see this in your browser:
480
480
481
481
## Styling
482
482
483
-
To get started with styling the chip, we need to import the `index` file, where all the theme functions and component mixins live:
483
+
Following the simplest approach, you can use CSS variables to customize the appearance of the chip:
484
+
485
+
```css
486
+
igx-chip {
487
+
--background: #cd201f;
488
+
--hover-background: #cd201f;
489
+
--focus-background: #9f1717;
490
+
--text-color: #fff;
491
+
}
492
+
```
493
+
By changing the values of these CSS variables, you can alter the entire look of the chip component.
494
+
495
+
<divclass="divider--half"></div>
496
+
497
+
Another way to style the chip is by using **Sass**, along with our [`chip-theme`]({environment:sassApiUrl}/index.html#function-chip-theme) function.
498
+
499
+
To start styling the chip using **Sass**, first import the `index` file, which includes all theme functions and component mixins:
484
500
485
501
```scss
486
502
@use"igniteui-angular/theming"as*;
@@ -492,21 +508,21 @@ To get started with styling the chip, we need to import the `index` file, where
492
508
Following the simplest approach, we create a new theme that extends the [`chip-theme`]({environment:sassApiUrl}/themes#function-chip-theme) and accepts some parameters that style the chip's items. By specifying the `$background` or the `$selected-background`, the theme automatically calculates appropriate state colors and contrast foregrounds. You can still override any other parameter with custom values as needed.
493
509
494
510
```scss
495
-
$custom-theme: chip-theme(
496
-
$background:#57a5cd,
497
-
$selected-background:#ecaa53,
498
-
$remove-icon-color:#d81414,
499
-
$border-radius:5px,
511
+
$custom-chip-theme: chip-theme(
512
+
$background:#57a5cd,
513
+
$selected-background:#ecaa53,
514
+
$remove-icon-color:#d81414,
515
+
$border-radius:5px,
500
516
);
501
517
```
502
518
503
-
The last step is to **include** the component theme in our application.
519
+
Finally, **include** the custom theme in your application:
504
520
505
521
```scss
506
-
@includecss-vars($custom-theme);
522
+
@includecss-vars($custom-chip-theme);
507
523
```
508
524
509
-
### Demo
525
+
In the sample below, you can see how using the chip component with customized CSS variables allows you to create a design that visually resembles the chip used in the [`Ant`](https://ant.design/components/tag?theme=light#tag-demo-icon) design system.
Copy file name to clipboardExpand all lines: en/components/input-group.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -452,7 +452,7 @@ To customize the appearance of input groups, you can create a new theme by exten
452
452
Even by specifying just a few core parameters—like colors for the border or background—you'll get a fully styled input group with consistent state-based styles (hover, focus, etc.) applied for you.
453
453
454
454
Here’s a simple example:
455
-
455
+
456
456
```scss
457
457
$custom-input-group: input-group-theme(
458
458
$box-background:#57a5cd,
@@ -466,14 +466,17 @@ The last step is to include the newly created theme:
466
466
@includecss-vars($custom-input-group);
467
467
```
468
468
469
-
### Demo
469
+
In the sample below, you can see how using the input group with customized CSS variables allows you to create a design that visually resembles the one used in the [`Carbon`](https://carbondesignsystem.com/components/text-input/usage/#live-demo) design system.
> The sample uses the [Indigo Light](themes/sass/schemas.md#predefined-schemas) schema.
479
+
477
480
>[!NOTE]
478
481
>If your page includes multiple types of input groups — such as `box`, `border`, `line`, or `search` — it's best to scope your theme variables to the specific input group type.
Copy file name to clipboardExpand all lines: en/components/radio-button.md
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,7 +146,30 @@ The final result would be something like that:
146
146
147
147
## Styling
148
148
149
-
To get started with styling the radio buttons, we need to import the `index` file, where all the theme functions and component mixins live:
149
+
Following the simplest approach, you can use CSS variables to customize the appearance of the radio button:
150
+
151
+
```css
152
+
igx-radio {
153
+
--empty-color: #556b81;
154
+
--label-color: #131e29;
155
+
--fill-color: #0064d9;
156
+
--focus-outline-color: #0032a5;
157
+
}
158
+
159
+
igx-radio:hover {
160
+
--empty-fill-color: #e3f0ff;
161
+
--empty-color: #0064d9;
162
+
--hover-color: transparent;
163
+
}
164
+
```
165
+
166
+
By changing the values of these CSS variables, you can alter the entire look of the component.
167
+
168
+
<divclass="divider--half"></div>
169
+
170
+
Another way to style the radio button is by using **Sass**, along with our [`radio-theme`]({environment:sassApiUrl}/index.html#function-radio-theme) function.
171
+
172
+
To start styling the radio button using **Sass**, first import the `index` file, which includes all theme functions and component mixins:
150
173
151
174
```scss
152
175
@use"igniteui-angular/theming"as*;
@@ -159,22 +182,27 @@ Following the simplest approach, we create a new theme that extends the [`radio-
159
182
160
183
```scss
161
184
$custom-radio-theme: radio-theme(
162
-
$empty-color:#345779,
163
-
$fill-color:#2dabe8,
185
+
$empty-color:#345779,
186
+
$fill-color:#2dabe8,
164
187
);
165
188
```
166
189
167
-
The last step is to pass the custom radio theme in our application:
190
+
Finally, **include**the custom theme in your application:
168
191
169
192
```scss
170
193
@includecss-vars($custom-radio-theme);
171
194
```
172
195
196
+
In the sample below, you can see how using the radio button with customized CSS variables allows you to create a design that visually resembles the radio button used in the [`SAP UI5`](https://ui5.sap.com/#/entity/sap.m.RadioButton/sample/sap.m.sample.RadioButton) design system.
0 commit comments