Skip to content

Commit 3ff0b28

Browse files
authored
Merge pull request #5969 from IgniteUI/fix-carousel-shadow-8.2
fix(carousel): fix carousel buttons shadow
2 parents d52573c + 49e03d8 commit 3ff0b28

File tree

8 files changed

+65
-13
lines changed

8 files changed

+65
-13
lines changed

projects/igniteui-angular/migrations/migration-collection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
"version": "8.2.0",
5151
"description": "Updates Ignite UI for Angular from v8.1.x to v8.2.0",
5252
"factory": "./update-8_2_0"
53+
},
54+
"migration-11": {
55+
"version": "8.2.3",
56+
"description": "Updates Ignite UI for Angular from v8.2.0 to v8.2.3",
57+
"factory": "./update-8_2_3"
5358
}
5459
}
5560
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"$schema": "../../common/schema/theme-props.schema.json",
33
"changes": [{
4-
"name": "$disable-shadow",
5-
"remove": true,
6-
"owner": "igx-badge-theme"
7-
}]
4+
"name": "$disable-shadow",
5+
"remove": true,
6+
"owner": "igx-badge-theme"
7+
}
8+
]
89
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../../common/schema/theme-props.schema.json",
3+
"changes": [{
4+
"name": "$disable-button-shadow",
5+
"replaceWith": "$button-shadow",
6+
"owner": "igx-carousel-theme"
7+
},
8+
]
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
8+
const version = '8.2.3';
9+
10+
export default function(): Rule {
11+
return (host: Tree, context: SchematicContext) => {
12+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
13+
14+
const update = new UpdateChanges(__dirname, host, context);
15+
update.applyChanges();
16+
};
17+
}

projects/igniteui-angular/src/lib/core/styles/components/carousel/_carousel-theme.scss

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// @param {Color} $indicator-dot-color [null] - The active indicator dot color.
1515
/// @param {Color} $indicator-border-color [null] - The idle indicator border color.
1616
/// @param {Color} $indicator-active-border-color [null] - The active indicator border color.
17-
/// @param {Bool} $disable-button-shadow [true] - Show shadow underneath the previous/next buttons.
17+
/// @param {box-shadow} $button-shadow [null] - Shadow underneath the previous/next buttons.
1818
///
1919
/// @param {border-radius} $border-radius [null] - The border radius used for carousel component.
2020
///
@@ -37,8 +37,10 @@
3737
@function igx-carousel-theme(
3838
$palette: $default-palette,
3939
$schema: $light-schema,
40+
$elevations: $elevations,
4041
4142
$border-radius: null,
43+
$button-shadow: null,
4244
4345
$button-background: null,
4446
$button-hover-background: null,
@@ -48,8 +50,6 @@
4850
$indicator-dot-color: null,
4951
$indicator-border-color: null,
5052
$indicator-active-border-color: null,
51-
52-
$disable-button-shadow: true
5353
){
5454
$name: 'igx-carousel';
5555
$carousel-schema: map-get($schema, $name);
@@ -59,7 +59,10 @@
5959
if($border-radius, $border-radius, map-get($carousel-schema, 'border-radius')),0 ,36px
6060
);
6161

62-
$button-shadow: if($disable-button-shadow == true, none, igx-elevation($elevations, 1));
62+
@if not($button-shadow) {
63+
$button-elevation: map-get($carousel-schema, 'button-elevation');
64+
$button-shadow: igx-elevation($elevations, $button-elevation);
65+
}
6366

6467
@if not($button-arrow-color) and $button-background {
6568
$button-arrow-color: text-contrast($button-background);
@@ -72,18 +75,18 @@
7275
@return extend($theme, (
7376
name: $name,
7477
palette: $palette,
78+
7579
border-radius: $border-radius,
80+
button-shadow: $button-shadow,
81+
7682
button-background: $button-background,
7783
button-hover-background: $button-hover-background,
7884
button-arrow-color: $button-arrow-color,
7985
button-hover-arrow-color: $button-hover-arrow-color,
80-
button-shadow: $button-shadow,
8186

8287
indicator-dot-color: $indicator-dot-color,
8388
indicator-border-color: $indicator-border-color,
8489
indicator-active-border-color: $indicator-active-border-color,
85-
86-
disable-button-shadow: $disable-button-shadow
8790
));
8891
}
8992

projects/igniteui-angular/src/lib/core/styles/themes/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
$palette,
194194
$schema,
195195
$border-radius: $roundness,
196-
$disable-button-shadow: if($elevation == false, 0, true),
196+
$button-shadow: if($elevation == false, 0, null),
197197
));
198198
}
199199

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
////
2+
/// @group schemas
3+
/// @access private
4+
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
5+
////
6+
$_default-elevation-carousel: (
7+
button-elevation: 1,
8+
);
9+
10+
$_fluent-elevation-carousel: (
11+
button-elevation: 0,
12+
);

projects/igniteui-angular/src/lib/core/styles/themes/schemas/light/_carousel.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../shape/carousel';
2+
@import '../elevation/carousel';
23

34
////
45
/// @group schemas
@@ -19,8 +20,10 @@
1920
///
2021
/// @requires {function} extend
2122
/// @requires {map} $_default-shape-carousel
23+
/// @requires {map} $_default-elevation-carousel
2224
$_light-carousel: extend(
2325
$_default-shape-carousel,
26+
$_default-elevation-carousel,
2427
(
2528
button-background: #fff,
2629
button-hover-background: #fff,
@@ -43,5 +46,7 @@ $_light-carousel: extend(
4346
/// @type {Map}
4447
/// @requires {function} extend
4548
/// @requires {map} $_light-carousel
49+
/// @requires {map} $_fluent-shape-carousel
50+
/// @requires {map} $_fluent-elevation-carousel
4651
/// @see $default-palette
47-
$_fluent-carousel: extend($_light-carousel, $_fluent-shape-carousel);
52+
$_fluent-carousel: extend($_light-carousel, $_fluent-shape-carousel, $_fluent-elevation-carousel);

0 commit comments

Comments
 (0)