Skip to content

Commit 862a5c3

Browse files
authored
Merge pull request #6620 from IgniteUI/igniteui-angular-6613
fix(bootstrap-theme): contrast colors, typography, and legacy-support
2 parents 95dd932 + 3500d41 commit 862a5c3

File tree

21 files changed

+145
-44
lines changed

21 files changed

+145
-44
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,3 @@ $components: () !default;
2323
/// The global themes registry map.
2424
$themes: () !default;
2525

26-
/// The global background color.
27-
$igx-background-color: #fff !default;
28-
$igx-foreground-color: rgba(0, 0, 0, .87) !default;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,19 @@
297297
/// @param {Color} $success [#4eb862] - The success color used throughout the application.
298298
/// @param {Color} $warn [#fbb13c] - The warning color used throughout the application.
299299
/// @param {Color} $error [#ff134a] - The error color used throughout the application.
300-
/// @param {Color} $grays [#000] - The color used for generating the grayscale palette.
300+
/// @param {Color} $grays [$igx-foreground-color] - The color used for generating the grayscale palette.
301301
/// @param {Color} $surface [#fff] - The color used as a background in components, such as cards, sheets, and menus.
302302
/// @returns {Map} - A map consisting of 74 color variations, including the `primary`, `secondary`, `grays`,
303303
/// `info`, `success`, `warn`, and `error` colors.
304+
/// @see $igx-foreground-color
304305
@function igx-palette(
305306
$primary,
306307
$secondary,
307308
$info: #1377d5,
308309
$success: #4eb862,
309310
$warn: #fbb13c,
310311
$error: #ff134a,
311-
$grays: #000,
312+
$grays: if(global-variable-exists('igx-foreground-color'), $igx-foreground-color, #000),
312313
$surface: #fff
313314
) {
314315
$saturations: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 'A100', 'A200', 'A400', 'A700');

projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,12 @@
645645

646646
%cal-value-content {
647647
position: relative;
648+
display: inline-flex;
649+
justify-content: center;
650+
align-items: center;
648651
width: $cal-value-w;
649652
height: $cal-value-h;
650653
min-width: 2ch;
651-
line-height: $cal-value-h;
652-
text-align: center;
653654
border-radius: --var($theme, 'date-border-radius');
654655
z-index: 0;
655656
// transition: background .15s ease-out;
@@ -944,7 +945,6 @@
944945

945946
%cal-header-date {
946947
@include igx-type-style($type-scale, $header-date) {
947-
line-height: rem(42px);
948948
margin: 0;
949949
}
950950
}

projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@
474474
}
475475
}
476476

477-
%igx-card-content,
478477
%igx-card-content > p {
479478
@include igx-type-style($type-scale, $content) {
480479
margin: 0;

projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232

233233
igx-list {
234234
margin: rem(8px) -#{rem(16px)} 0;
235+
border: 0;
235236
border-top: 1px dashed igx-color($palette, 'grays', 300);
236237
border-bottom: 1px dashed igx-color($palette, 'grays', 300);
237238
}

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@
540540
$bootstrap-theme: $variant == 'bootstrap';
541541
$not-bootstrap-theme: $variant != 'bootstrap';
542542

543-
$bootstrap-header-border-bottom-width: --var($theme, 'header-border-width') * 2;
544543
$cbx-size: map-get((
545544
material: rem(20px),
546545
fluent: rem(20px),
@@ -705,7 +704,7 @@
705704
border-bottom: $grid-header-border;
706705

707706
@if $bootstrap-theme {
708-
border-bottom-width: $bootstrap-header-border-bottom-width;
707+
border-bottom-width: rem(2px);
709708
}
710709

711710
z-index: 2;

projects/igniteui-angular/src/lib/core/styles/components/paginator/_paginator-theme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141

4242
$theme: apply-palette($grid-paginator-schema, $palette);
4343

44+
45+
@if not($text-color) and $background-color {
46+
$text-color: text-contrast($background-color);
47+
}
48+
4449
@return extend($theme, (
4550
name: $name,
4651
palette: $palette,

projects/igniteui-angular/src/lib/core/styles/components/ripple/_ripple-theme.scss

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@
4848
@mixin igx-ripple($theme, $palette: $default-palette) {
4949
@include igx-root-css-vars($theme);
5050

51-
$variant: map-get($theme, variant);
52-
53-
$ripple-display: map-get((
54-
material: block,
55-
fluent: none !important,
56-
bootstrap: none !important
57-
), $variant);
58-
5951
%igx-ripple-display {
60-
display: $ripple-display;
52+
display: block;
6153
position: absolute;
6254
border-radius: 50%;
6355
background: --var($theme, 'color');

projects/igniteui-angular/src/lib/core/styles/components/tabs/_tabs-theme.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
align-items: center;
241241
overflow: hidden;
242242
background: --var($theme, 'item-background');
243+
243244
@if $not-bootstrap-theme {
244245
box-shadow: --var($theme, 'tab-area-shadow');
245246
}
@@ -350,6 +351,9 @@
350351
outline: 0;
351352
color: --var($theme, 'item-active-color');
352353

354+
@if $bootstrap-theme {
355+
border-color: --var($theme, 'border-color--hover') --var($theme, 'border-color--hover') transparent;
356+
}
353357

354358
&:focus {
355359
background: --var($theme, 'item-active-background');
@@ -375,7 +379,10 @@
375379
background: --var($theme, 'item-active-background');
376380
position: relative;
377381
z-index: 1;
378-
border-color: --var($theme, 'border-color') --var($theme, 'border-color') --var($theme, 'item-active-background');
382+
border-top-color: --var($theme, 'border-color');
383+
border-left-color: --var($theme, 'border-color');
384+
border-right-color: --var($theme, 'border-color');
385+
border-bottom-color: transparent;
379386

380387
&::after {
381388
content: '';
@@ -389,7 +396,10 @@
389396

390397
&:hover,
391398
&:focus {
392-
border-color: --var($theme, 'border-color') --var($theme, 'border-color') transparent;
399+
border-top-color: --var($theme, 'border-color');
400+
border-left-color: --var($theme, 'border-color');
401+
border-right-color: --var($theme, 'border-color');
402+
border-bottom-color: transparent;
393403
}
394404
}
395405
}

projects/igniteui-angular/src/lib/core/styles/components/time-picker/_time-picker-theme.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@
354354
}
355355

356356
%time-picker__header-hour {
357-
@include igx-type-style($type-scale, $header-hour);
357+
@include igx-type-style($type-scale, $header-hour) {
358+
margin-top: 0;
359+
}
358360
}
359361

360362
%time-picker__column {

0 commit comments

Comments
 (0)