Skip to content

Commit 4dc4821

Browse files
authored
Merge pull request #5336 from IgniteUI/fluent-theme
feat(fluent theme): Initial implementation
2 parents 1ad1df3 + 05e8f46 commit 4dc4821

File tree

159 files changed

+4079
-693
lines changed

Some content is hidden

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

159 files changed

+4079
-693
lines changed

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,28 @@ All notable changes for each version of this project will be documented in this
102102
## 8.1.0
103103

104104
### New Features
105+
106+
##### New theme
107+
Ignite UI for angular now have a new theme that mimics the Microsoft Fluent design as much as possible.
108+
In order to use the theme you have to use one of the following mixins:
109+
`igx-fluent-theme` and `igx-fluent-dark-theme`
110+
111+
We also added two new pallets that go with the new theme, `$fluent-word-palette` and `$fluent-excel-palette`.
112+
113+
This is an example of how you can use the new theme.
114+
115+
```scss
116+
// Light version
117+
.fluent-word-theme {
118+
@include igx-fluent-theme($fluent-word-palette);
119+
}
120+
121+
// Dark version
122+
.fluent-excel-dark-theme {
123+
@include igx-fluent-dark-theme($fluent-excel-palette);
124+
}
125+
```
126+
105127
- `IgxBottomNav` now supports an `igx-tab` declaration mode. When in this mode, panels declarations are not accepted and tab items' content is not rendered.
106128
- You can use this mode to apply directives on the tab items - for example to achieve routing navigation.
107129
- You are allowed to customize tab items with labels, icons and even templates.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<ng-container *ngIf="!isHeader">
22
<igx-checkbox [checked]="selected" disableRipple="true" [disableTransitions]="disableTransitions" [tabindex]="-1" (click)="disableCheck($event)" class="igx-combo__checkbox"></igx-checkbox>
33
</ng-container>
4-
<ng-content></ng-content>
4+
<ng-content></ng-content>

projects/igniteui-angular/src/lib/core/styles/base/utilities/_functions.scss

+51-51
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,24 @@
111111
@return #fff;
112112
}
113113

114-
/// Retrieves a contrast text color for a given color from a color palette.
114+
/// Converts a rgba color to a hexidecimal color.
115115
/// @access public
116-
/// @group Palettes
117-
/// @param {Map} $palette - The source palette map.
118-
/// @param {string} $color - The target color from the color palette.
119-
/// @param {number|variant} $variant - The target color shade from the color palette.
120-
/// @requires igx-color
121-
/// @requires text-contrast
122-
/// @requires hexrgba
123-
/// @returns {Color} [#fff] - Returns white if now palette, color and/or variant matches found.
124-
@function igx-contrast-color($palette, $color, $variant: 500) {
125-
$_color: igx-color($palette, $color, $variant);
126-
@if $_color {
127-
@return text-contrast(hexrgba($_color));
116+
/// @requires {function} to-string
117+
/// @param {Color} $rgba - The rgba color to convert.
118+
/// @param {Color} $background - The background color to convert against.
119+
/// @return {Color} - The hexidecimal representation of the rgba value.
120+
@function hexrgba($rgba, $background: #fff) {
121+
@if type-of($rgba) == color {
122+
$red: red($rgba);
123+
$green: green($rgba);
124+
$blue: blue($rgba);
125+
$a: alpha($rgba);
126+
$r: floor($a * $red + (1 - $a) * red($background));
127+
$g: floor($a * $green + (1 - $a) * green($background));
128+
$b: floor($a * $blue + (1 - $a) * blue($background));
129+
@return rgb($r, $g, $b);
128130
}
129-
@return #fff;
131+
@return $rgba;
130132
}
131133

132134
/// Returns a contrast color for a passed color.
@@ -138,7 +140,7 @@
138140
@if type-of($color) == 'color' {
139141
$lightContrast: contrast($color, white);
140142
$darkContrast: contrast($color, black);
141-
143+
142144
@if ($lightContrast > $darkContrast) {
143145
@return white;
144146
} @else {
@@ -148,6 +150,24 @@
148150
@return $color;
149151
}
150152

153+
/// Retrieves a contrast text color for a given color from a color palette.
154+
/// @access public
155+
/// @group Palettes
156+
/// @param {Map} $palette - The source palette map.
157+
/// @param {string} $color - The target color from the color palette.
158+
/// @param {number|variant} $variant - The target color shade from the color palette.
159+
/// @requires igx-color
160+
/// @requires text-contrast
161+
/// @requires hexrgba
162+
/// @returns {Color} [#fff] - Returns white if now palette, color and/or variant matches found.
163+
@function igx-contrast-color($palette, $color, $variant: 500) {
164+
$_color: igx-color($palette, $color, $variant);
165+
@if $_color {
166+
@return text-contrast(hexrgba($_color));
167+
}
168+
@return #fff;
169+
}
170+
151171
/// Test if `$value` is a valid direction.
152172
/// @access private
153173
/// @param {*} $value - The value to test.
@@ -198,54 +218,34 @@
198218
@return $sign + $result;
199219
}
200220

201-
/// Converts a rgba color to a hexidecimal color.
202-
/// @access public
203-
/// @requires {function} to-string
204-
/// @param {Color} $rgba - The rgba color to convert.
205-
/// @param {Color} $background - The background color to convert against.
206-
/// @return {Color} - The hexidecimal representation of the rgba value.
207-
@function hexrgba($rgba, $background: #fff) {
208-
@if type-of($rgba) == color {
209-
$red: red($rgba);
210-
$green: green($rgba);
211-
$blue: blue($rgba);
212-
$a: alpha($rgba);
213-
$r: floor($a * $red + (1 - $a) * red($background));
214-
$g: floor($a * $green + (1 - $a) * green($background));
215-
$b: floor($a * $blue + (1 - $a) * blue($background));
216-
@return rgb($r, $g, $b);
217-
}
218-
@return $rgba;
219-
}
220-
221-
/// Extends a Map object with the properties of another Map object.
222-
/// @access private
223-
/// @param {Map...} $maps - The source map to get extended.
224-
/// @returns {Map} - Returns the merged maps.
225-
@function extend($maps...) {
226-
$result: ();
227-
228-
@each $map in $maps {
229-
$result: map-merge($result, map-clean($map));
230-
}
231-
232-
@return $result;
233-
}
234-
235221
/// Removes all null key-value pairs from the map
236222
/// @access private
237223
/// @param {Map} $map - The target map to be cleaned.
238224
/// @returns {Map} - Returns a clean map.
239225
@function map-clean($map) {
240226
$result: ();
241-
227+
242228
@each $key, $value in $map {
243229
@if($value) != null {
244230
$result: map-merge($result, (
245231
#{$key}: $value
246232
));
247233
}
248234
}
235+
236+
@return $result;
237+
}
238+
239+
/// Extends a Map object with the properties of another Map object.
240+
/// @access private
241+
/// @param {Map...} $maps - The source map to get extended.
242+
/// @returns {Map} - Returns the merged maps.
243+
@function extend($maps...) {
244+
$result: ();
245+
246+
@each $map in $maps {
247+
$result: map-merge($result, map-clean($map));
248+
}
249249

250250
@return $result;
251251
}
@@ -309,7 +309,7 @@
309309
$warn: #fbb13c,
310310
$error: #ff134a,
311311
$grays: #000,
312-
$surface: #fff,
312+
$surface: #fff
313313
) {
314314
$saturations: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 'A100', 'A200', 'A400', 'A700');
315315
$shades: (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87);

projects/igniteui-angular/src/lib/core/styles/base/utilities/_mixins.scss

+23
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
44
////
55

6+
/// Help debug sass maps.
7+
/// @access privet
8+
/// @example scss - Sample usage
9+
/// input[type="checkbox"] {
10+
/// @include hide-default();
11+
/// }
12+
13+
//@mixin debug-map($map) {
14+
// @at-root {
15+
// @debug-map {
16+
// __toString__: inspect($map);
17+
// __length__: length($map);
18+
// __keys__: map-keys($map);
19+
//
20+
// __properties__ {
21+
// @each $key, $value in $map {
22+
// #{$key}: inspect($value);
23+
// }
24+
// }
25+
// }
26+
// }
27+
//}
28+
629
/// Hides the element from the DOM.
730
/// @access public
831
/// @example scss - Sample usage

projects/igniteui-angular/src/lib/core/styles/components/banner/_banner-theme.scss

+4-6
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,10 @@
142142
) {
143143
$message: map-get($categories, 'message');
144144

145-
@include igx-scope('.igx-typography') {
146-
%igx-banner__text {
147-
@include igx-type-style($type-scale, $message) {
148-
margin-top: 0;
149-
margin-bottom: 0;
150-
}
145+
%igx-banner__text {
146+
@include igx-type-style($type-scale, $message) {
147+
margin-top: 0;
148+
margin-bottom: 0;
151149
}
152150
}
153151
}

projects/igniteui-angular/src/lib/core/styles/components/bottom-nav/_bottom-nav-theme.scss

+4-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
$background: null,
3636
$idle-item-color: null,
3737
$active-item-color: null,
38-
$shadow: null,
38+
$shadow: null
3939
) {
4040
$name: 'igx-bottom-nav';
4141
$bottom-nav-schema: map-get($schema, $name);
@@ -75,8 +75,6 @@
7575
@mixin igx-bottom-nav($theme) {
7676
@include igx-root-css-vars($theme);
7777

78-
// @debug $theme;
79-
8078
$menu-height: 56px;
8179
$item-min-width: 80px;
8280
$item-max-width: 168px;
@@ -193,11 +191,9 @@
193191
@mixin igx-bottom-nav-typography($type-scale, $categories: (label: 'caption')) {
194192
$label: map-get($categories, 'label');
195193

196-
@include igx-scope('.igx-typography') {
197-
%igx-tab-label {
198-
@include igx-type-style($type-scale, $label) {
199-
margin: 0
200-
}
194+
%igx-tab-label {
195+
@include igx-type-style($type-scale, $label) {
196+
margin: 0
201197
}
202198
}
203199
}

projects/igniteui-angular/src/lib/core/styles/components/button-group/_button-group-theme.scss

+17-9
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
$item-selected-text-color: null,
6868
$item-selected-background: null,
6969
$item-selected-border-color: null,
70-
$item-selected-hover-background: null,
70+
$item-selected-hover-background: null
7171
) {
7272
$name: 'igx-button-group';
7373
$button-group-schema: map-get($schema, $name);
@@ -149,19 +149,17 @@
149149
$group-item-min-width: 24px;
150150
$group-item-border-thickness: 1px;
151151
$group-items-margin: rem(10px, 16px);
152+
$transition: all 140ms $ease-in-out-quad;
152153

153154
%igx-group-display {
154155
display: flex;
155156
box-shadow: --var($theme, 'shadow');
156-
transition: all 140ms $ease-in-out-quad;
157+
transition: $transition;
157158
border-radius: --var($theme, 'border-radius')
158159
}
159160

160161
%igx-group-item {
161-
&%igx-button--flat {
162-
border-radius: 0;
163-
}
164-
162+
@include ellipsis();
165163
border: $group-item-border-thickness solid --var($theme, 'item-border-color');
166164
color: --var($theme, 'item-text-color');
167165
background: --var($theme, 'item-background');
@@ -175,13 +173,19 @@
175173
user-select: none;
176174
position: relative;
177175
z-index: 0;
178-
@include ellipsis();
176+
transition: $transition;
179177

180-
&:not(:nth-child(0)) {
181-
margin-left: -1px;
178+
&%igx-button--flat {
179+
border-radius: 0;
182180
}
183181

182+
%igx-icon-display {
183+
color: currentColor;
184+
}
184185

186+
&:not(:nth-child(0)) {
187+
margin-left: -1px;
188+
}
185189

186190
&:first-of-type {
187191
border-radius: --var($theme, 'border-radius') 0 0 --var($theme, 'border-radius');
@@ -199,6 +203,10 @@
199203

200204
&:hover,
201205
&:focus {
206+
%igx-icon-display {
207+
color: currentColor;
208+
}
209+
202210
color: --var($theme, 'item-hover-text-color');
203211
background: --var($theme, 'item-hover-background');
204212
z-index: 1;

0 commit comments

Comments
 (0)