Skip to content

Commit 3abaedb

Browse files
authored
Merge pull request #6016 from IgniteUI/apetrov/update-theme-docs
refactor(themes): updating docs
2 parents 63c8777 + b34ffe0 commit 3abaedb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2673
-5289
lines changed

.DS_Store

6 KB
Binary file not shown.

en/.DS_Store

8 KB
Binary file not shown.

en/components/.DS_Store

18 KB
Binary file not shown.

en/components/accordion.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In it, you can see how to define an `igx-accrodion` and its [expansion panels]({
1919

2020
<code-view style="height:460px"
2121
data-demos-base-url="{environment:demosBaseUrl}"
22-
iframe-src="{environment:demosBaseUrl}/layouts/accordion-sample-1" alt="Angular Avatar Example">
22+
iframe-src="{environment:demosBaseUrl}/layouts/accordion-sample-1" alt="Angular Accordion Example">
2323
</code-view>
2424

2525
<div class="divider--half"></div>
@@ -239,7 +239,7 @@ You can see the result below.
239239

240240
<code-view style="height:550px"
241241
data-demos-base-url="{environment:demosBaseUrl}"
242-
iframe-src="{environment:demosBaseUrl}/layouts/accordion-sample-2" alt="Angular Avatar Example">
242+
iframe-src="{environment:demosBaseUrl}/layouts/accordion-sample-2" alt="Angular Accordion Example">
243243
</code-view>
244244

245245
<div class="divider--half"></div>
@@ -261,8 +261,9 @@ The [IgxAccordionComponent]({environment:angularApiUrl}/classes/igxaccordioncomp
261261
- <kbd>Home</kbd> - navigates to the FIRST enabled panel in the accordion
262262
- <kbd>End</kbd> - navigates to the LAST enabled panel in the accordion
263263

264-
## Angular Accordion Styling
265-
The [accordion]({environment:angularApiUrl}/classes/igxaccordioncomponent.html) serves only as a container for the underlying [panels]({environment:angularApiUrl}/classes/igxexpansionpanelcomponent.html). Styles can be applied directly through the panel's theme, as described in the [styling section of the IgxExpansionPanel topic](expansion-panel.md#styling).
264+
## Styling
265+
266+
The [`accordion`]({environment:angularApiUrl}/classes/igxaccordioncomponent.html) serves only as a container for the underlying [`panels`]({environment:angularApiUrl}/classes/igxexpansionpanelcomponent.html). Styles can be applied directly through the panel's theme, as described in the [`styling section of the IgxExpansionPanel topic`](expansion-panel.md#styling).
266267

267268
By design, there is a margin set to the expanded panels, in case that they are positioned within an `igx-accordion`. In order to modify it there is a property exposed inside the igx-expansion-panel theme.
268269
In order to take advantage of the functions exposed by the theming engine, we have to import the `index` file in our style file:
@@ -274,33 +275,27 @@ In order to take advantage of the functions exposed by the theming engine, we ha
274275
// @import '~igniteui-angular/lib/core/styles/themes/index';
275276
```
276277

277-
Following the simplest approach, we create a new theme that extends the [expansion-panel-theme]({environment:sassApiUrl}/index.html#function-expansion-panel-theme) and accepts an `$expanded-margin` parameter.
278+
Following the simplest approach, we create a new theme that extends the [`expansion-panel-theme`]({environment:sassApiUrl}/index.html#function-expansion-panel-theme) and accepts an `$expanded-margin`, `$body-color` and `$header-focus-background` parameters.
278279
```scss
279280
$custom-panel-theme: expansion-panel-theme(
280-
$expanded-margin: 0px
281+
$expanded-margin: 10px,
282+
$body-color: #282885,
283+
$header-focus-background: #efefef
281284
);
282285
```
283-
### Using CSS Variables
284286

285287
The last step is to include the component's theme.
286288
```scss
287-
:host {
288-
@include css-vars($custom-panel-theme);
289-
}
289+
@include css-vars($custom-panel-theme);
290290
```
291291

292-
### Using Theme Overrides
292+
### Demo
293293

294-
In order to style components in Internet Explorer 11, we have to use a different approach, since CSS variables are not supported there.
294+
<code-view style="height:350px"
295+
data-demos-base-url="{environment:demosBaseUrl}"
296+
iframe-src="{environment:demosBaseUrl}/layouts/accordion-style" alt="Angular Accordion Style Example">
297+
</code-view>
295298

296-
If the component is using the [Emulated](themes/sass/component-themes.md#view-encapsulation) `ViewEncapsulation`, it is necessary to `penetrate` this encapsulation using `::ng-deep`. To prevent the custom theme from leaking into other components, make sure to wrap the `::ng-deep` in a `:host` selector:
297-
```scss
298-
:host {
299-
::ng-deep {
300-
@include expansion-panel($custom-panel-theme);
301-
}
302-
}
303-
```
304299
## API Reference
305300
* [IgxAccordion API]({environment:angularApiUrl}/classes/igxaccordioncomponent.html)
306301
* [IgxExpansionPanel API]({environment:angularApiUrl}/classes/igxexpansionpanelcomponent.html)

en/components/action-strip.md

Lines changed: 39 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,18 @@ _keywords: Angular Action Strip component, Angular Action Strip directive, Angul
55
---
66

77
# Angular Action Strip Directive Overview
8+
89
<p class="highlight">
910
The Ignite UI for Angular Action Strip component provides an overlay area containing one or more actions allowing additional UI and functionality to be shown on top of a specific target container upon user interaction e.g. hover. The container should be positioned relatively as the Action Strip attempts to overlay it and is itself positioned absolutely. Despite overlapped by an Action Strip, the main interactions and user access to the target container remain available.
1011
</p>
1112

12-
<div class="divider--half"></div>
13-
1413
## Angular Action Strip Example
1514

16-
1715
<code-view style="height: 400px;"
1816
data-demos-base-url="{environment:demosBaseUrl}"
1917
iframe-src="{environment:demosBaseUrl}/menus/action-strip-paragraph" alt="Angular Action Strip Example">
2018
</code-view>
2119

22-
2320
<div class="divider--half"></div>
2421

2522
## Getting Started with Ignite UI for Angular Action Strip
@@ -32,7 +29,7 @@ ng add igniteui-angular
3229

3330
For a complete introduction to the Ignite UI for Angular, read the [*getting started*](general/getting-started.md) topic.
3431

35-
The next step is to import the `IgxActionStripModule` in your **app.module.ts** file.
32+
The next step is to import the `IgxActionStripModule` in your **app.module.ts** file.
3633

3734
```typescript
3835
// app.module.ts
@@ -80,46 +77,46 @@ export class HomeComponent {}
8077
Now that you have the Ignite UI for Angular Action Strip module or directives imported, you can start with a basic configuration of the `igx-action-strip` component.
8178

8279
## Using the Angular Action Strip Component
80+
8381
To initialize and position the Action Strip correctly, it needs to be inside a relatively positioned container:
8482

8583
```html
8684
<div style="position:relative; width:100px; height:100px;">
87-
<igx-action-strip>
88-
<button igxButton (click)="makeTextBold()">
89-
<igx-icon>format_bold</igx-icon>
90-
</button>
91-
</igx-action-strip>
92-
<div>
85+
<igx-action-strip>
86+
<button igxButton (click)="makeTextBold()">
87+
<igx-icon>format_bold</igx-icon>
88+
</button>
89+
</igx-action-strip>
90+
</div>
9391
```
9492

9593
By default, the Action Strip will be visible, but this can be configured via the [`hidden`]({environment:angularApiUrl}/classes/igxactionstripcomponent.html#hidden) @Input property.
9694

9795
### Menu look and feel
96+
9897
For scenarios where more than three action items will be shown, it is best to use [`IgxActionStripMenuItem`]({environment:angularApiUrl}/classes/igxactionstripmenuitemdirective.html) directive. Any item within the Action Strip marked with the `*igxActionStripMenuItem` structural directive will be shown in a dropdown, revealed upon toggling the more button i.e. the three dots representing the last action.
9998

10099
```html
101100
<div style="position:relative; width:100px; height:100px;">
102-
<igx-action-strip>
103-
<button *igxActionStripMenuItem igxButton (click)="alignTextLeft()">
104-
<igx-icon>format_align_left</igx-icon>
105-
</button>
106-
<button *igxActionStripMenuItem igxButton (click)="alignTextCenter()">
107-
<igx-icon>format_align_center</igx-icon>
108-
</button>
109-
<button *igxActionStripMenuItem igxButton (click)="alignTextRight()">
110-
<igx-icon>format_align_right</igx-icon>
111-
</button>
112-
</igx-action-strip>
101+
<igx-action-strip>
102+
<button *igxActionStripMenuItem igxButton (click)="alignTextLeft()">
103+
<igx-icon>format_align_left</igx-icon>
104+
</button>
105+
<button *igxActionStripMenuItem igxButton (click)="alignTextCenter()">
106+
<igx-icon>format_align_center</igx-icon>
107+
</button>
108+
<button *igxActionStripMenuItem igxButton (click)="alignTextRight()">
109+
<igx-icon>format_align_right</igx-icon>
110+
</button>
111+
</igx-action-strip>
113112
</div>
114113
```
115114

116-
117115
<code-view style="height: 400px;"
118116
data-demos-base-url="{environment:demosBaseUrl}"
119117
iframe-src="{environment:demosBaseUrl}/menus/action-strip-paragraph-menu" >
120118
</code-view>
121119

122-
123120
### Reusing the Action Strip
124121

125122
The same Action Strip instance can be used in multiple places in the document as long as the actions need not be visible simultaneously for them.
@@ -129,25 +126,25 @@ The best way to do so is via the [`show`]({environment:angularApiUrl}/classes/ig
129126
> [!NOTE]
130127
> The `show` API method uses [Angular Renderer2](https://angular.io/api/core/Renderer2) to append the Action Strip to that `element`.
131128
132-
133129
## Usage in Grids
134130

135131
The Action Strip provides additional functionality and UI for the IgxGrid.
136132
This can be utilized via grid action components and we are providing two default ones:
133+
137134
- [`IgxGridEditingActionsComponent`]({environment:angularApiUrl}/classes/igxgrideditingactionscomponent.html) - includes functionality and UI related to grid editing. It allows you to quickly toggle edit mode for cells or rows, depending on the value of the `rowEditable` option of the grid and whether deleting rows is allowed.
138135
- [`IgxGridPinningActionsComponent`]({environment:angularApiUrl}/classes/igxgridpinningactionscomponent.html) - includes functionality and UI related to grid row pinning. It allows you to quickly pin rows and navigate between pinned rows and their disabled counterparts.
139136

140137
```html
141138
<igx-grid [data]="data" [rowEditable]="true" [primaryKey]="'ID'">
142-
<igx-column *ngFor="let c of columns" [field]="c.field">
143-
</igx-column>
139+
<igx-column *ngFor="let c of columns" [field]="c.field"> </igx-column>
144140

145-
<igx-action-strip #actionStrip>
146-
<igx-grid-pinning-actions></igx-grid-pinning-actions>
147-
<igx-grid-editing-actions></igx-grid-editing-actions>
148-
</igx-action-strip>
141+
<igx-action-strip #actionStrip>
142+
<igx-grid-pinning-actions></igx-grid-pinning-actions>
143+
<igx-grid-editing-actions></igx-grid-editing-actions>
144+
</igx-action-strip>
149145
</igx-grid>
150146
```
147+
151148
> [!NOTE]
152149
> These components inherit [`IgxGridActionsBaseDirective`]({environment:angularApiUrl}/classes/igxgridactionsbasedirective.html) and when creating a custom grid action component, it should also inherit `IgxGridActionsBaseDirective`.
153150
@@ -165,52 +162,42 @@ This can be utilized via grid action components and we are providing two default
165162
## Styling
166163

167164
To customize the Action Strip, you first need to import the `index` file, where all styling functions and mixins are located.
165+
168166
```scss
169167
@use "igniteui-angular/theming" as *;
170168

171169
// IMPORTANT: Prior to Ignite UI for Angular version 13 use:
172170
// @import '~igniteui-angular/lib/core/styles/themes/index';
173-
```
171+
```
172+
174173
Next, we have to create a new theme that extends the `action-strip-theme` and pass the parameters which we'd like to change:
174+
175175
```scss
176176
$custom-strip: action-strip-theme(
177-
$background: rgba(150, 133, 143, 0.4),
178-
$actions-background: rgba(109, 121, 147, 0.6),
179-
$icon-color: null,
180-
$delete-action: null,
181-
$actions-border-radius: 0
177+
$background: rgba(150, 133, 143, 0.4),
178+
$actions-background: rgba(109, 121, 147, 0.6),
179+
$icon-color: null,
180+
$delete-action: null,
181+
$actions-border-radius: 0,
182182
);
183183
```
184184

185185
The last step is to include the newly created component theme in our application.
186186

187-
When `$legacy-support` is set to `false`(default), include the component css variables like this:
188187
```scss
189188
@include css-vars($custom-strip);
190189
```
191190

192-
When `$legacy-support` is set to `true`, include the component theme like this:
193-
```scss
194-
@include action-strip($custom-strip);
195-
```
196-
197191
<code-view style="height: 400px;"
198192
no-theming
199193
data-demos-base-url="{environment:demosBaseUrl}"
200194
iframe-src="{environment:demosBaseUrl}/menus/action-strip-styling" >
201195
</code-view>
202196

203-
## Known Issues and Limitations
204-
205-
- Using the Action Strip component on IE11 requires the explicit import of the array polyfill in polyfill.ts of the angular application.
206-
207-
```typescript
208-
import 'core-js/es7/array';
209-
```
210-
211197
## API and Style References
212198

213199
For more detailed information regarding the Action Strip API, refer to the following links:
200+
214201
* [`IgxActionStripComponent API`]({environment:angularApiUrl}/classes/igxactionstripcomponent.html)
215202

216203
The following built-in CSS styles helped us achieve this Action Strip layout:
@@ -224,10 +211,10 @@ Additional components and/or directives that can be used within the Action Strip
224211
* [`IgxGridEditingActionsComponent`]({environment:angularApiUrl}/classes/igxgrideditingactionscomponent.html)
225212
* [`IgxDividerDirective`]({environment:angularApiUrl}/classes/igxdividerdirective.html)
226213

227-
228214
<div class="divider"></div>
229215

230216
## Theming Dependencies
217+
231218
* [IgxButton Theme]({environment:sassApiUrl}/index.html#function-button-theme)
232219
* [IgxRipple Theme]({environment:sassApiUrl}/index.html#function-ripple-theme)
233220
* [IgxDropDown Theme]({environment:sassApiUrl}/index.html#function-drop-down-theme)

en/components/autocomplete.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Angular Autocomplete is a search box directive that enables users to easily find
1111

1212
The [`igxAutocomplete`]({environment:angularApiUrl}/classes/igxautocompletedirective.html) directive provides a way to enhance a text input by showing an [`igxDropDown`]({environment:angularApiUrl}/classes/igxdropdowncomponent.html) with suggested options, provided by the developer. The suggestions will show once you start typing in the text input or use the `Arrow Up`/`Arrow Down` keys.
1313
</p>
14-
<div class="divider"></div>
1514

1615
## Angular Autocomplete Example
1716

@@ -256,7 +255,7 @@ The `drop-down` component, used as provider for suggestions, will expose the fol
256255
## Styling
257256
Every component has its own theme.
258257

259-
To get the `igxAutocomplete` styled, you have style its containing components. In our case, we need to use both the [input-group-theme]({environment:sassApiUrl}/index.html#function-input-group-theme) and the [drop-down-theme]({environment:sassApiUrl}/index.html#function-drop-down-theme).
258+
To get the `igxAutocomplete` styled, you have to style its containing components. In our case, these are the [input-group-theme]({environment:sassApiUrl}/index.html#function-input-group-theme) and the [drop-down-theme]({environment:sassApiUrl}/index.html#function-drop-down-theme).
260259

261260
Take a look at the [`igxInputGroup`](input-group.md#styling) and the [`igxDropdown`](drop-down.md#styling) styling sections to get a better understanding of how to style those two components.
262261

en/components/avatar.md

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ We can also change the background through the `background` property or set a col
9292
// avatar.component.scss
9393

9494
igx-avatar {
95-
background: #e41c77;
96-
color: #000000;
95+
background: #e41c77;
96+
color: #000000;
9797
}
9898

9999
```
@@ -155,45 +155,26 @@ Following the simplest approach, we create a new theme that extends the [`avatar
155155
Given the following markup:
156156

157157
```html
158-
<div class="initials-avatar">
159-
<igx-avatar>BA</igx-avatar>
158+
<div class="avatar-sample initials">
159+
<igx-avatar initials="JS" size="medium"></igx-avatar>
160160
</div>
161161
```
162162

163-
We need to create a theme:
163+
We create the following avatar theme:
164164

165165
```scss
166166
$custom-avatar-theme: avatar-theme(
167-
$background: #72da67,
168-
$color: #000000,
169-
$border-radius: 16px
167+
$background: #72da67,
168+
$color: #000000,
169+
$border-radius: 16px
170170
);
171171
```
172172

173-
### Using CSS variables
174-
175173
The last step is to pass the custom avatar theme:
176174

177175
```scss
178-
.initials-avatar {
179-
@include css-vars($custom-avatar-theme);
180-
}
181-
```
182-
183-
### Using mixins
184-
185-
In order to style components for Internet Explorer 11 and older browsers, we have to use different approach, since it doesn't support CSS variables.
186-
187-
If the component is using an [`Emulated`](themes/sass/component-themes.md#view-encapsulation) ViewEncapsulation, it is necessary to `penetrate` this encapsulation using `::ng-deep`. On the other side, in order to prevent the custom theme to leak to other components, be sure to include the `:host` selector before `::ng-deep`:
188-
189-
```scss
190-
:host {
191-
::ng-deep {
192-
// Pass the custom avatar theme to the `igx-avatar` mixin
193-
.initials-avatar {
194-
@include avatar($custom-avatar-theme);
195-
}
196-
}
176+
.initials {
177+
@include css-vars($custom-avatar-theme);
197178
}
198179
```
199180

@@ -233,7 +214,7 @@ You can also use one of the predefined sizes, assigning it to the `--ig-size` va
233214

234215
```scss
235216
igx-avatar {
236-
--ig-size: var(--ig-size-small);
217+
--ig-size: var(--ig-size-small);
237218
}
238219
```
239220

0 commit comments

Comments
 (0)