Skip to content

Commit 3902721

Browse files
author
MPopov
committed
fix(themes): do not set the global text color in igx-core
BREAKING CHANGE: Remove $base-color from igx-typography
1 parent 9b85f8f commit 3902721

File tree

7 files changed

+63
-10
lines changed

7 files changed

+63
-10
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
"version": "9.0.0",
6666
"description": "Updates Ignite UI for Angular from v8.2.x to v9.0.0",
6767
"factory": "./update-9_0_0"
68+
},
69+
"migration-14": {
70+
"version": "9.0.1",
71+
"description": "Updates Ignite UI for Angular from v9.0.0 to v9.0.1",
72+
"factory": "./update-9_0_1"
6873
}
6974
}
7075
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../common/schema/theme-props.schema.json",
3+
"changes": [
4+
{
5+
"name": "$base-color",
6+
"remove": true,
7+
"owner": "igx-typography"
8+
}
9+
]
10+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import * as path from 'path';
2+
3+
// tslint:disable:no-implicit-dependencies
4+
import { virtualFs } from '@angular-devkit/core';
5+
import { EmptyTree } from '@angular-devkit/schematics';
6+
// tslint:disable-next-line:no-submodule-imports
7+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
8+
9+
describe('Update 9.0.1', () => {
10+
let appTree: UnitTestTree;
11+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
12+
const configJson = {
13+
defaultProject: 'testProj',
14+
projects: {
15+
testProj: {
16+
sourceRoot: '/testSrc'
17+
}
18+
},
19+
schematics: {
20+
'@schematics/angular:component': {
21+
prefix: 'appPrefix'
22+
}
23+
}
24+
};
25+
26+
beforeEach(() => {
27+
appTree = new UnitTestTree(new EmptyTree());
28+
appTree.create('/angular.json', JSON.stringify(configJson));
29+
});
30+
});
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 = '9.0.1';
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/base/utilities/_functions.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,6 @@
315315
$saturations: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 'A100', 'A200', 'A400', 'A700');
316316
$shades: (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87);
317317

318-
@if global-variable-exists('igx-foreground-color') and type-of($igx-foreground-color) == 'color' {
319-
$grays: $igx-foreground-color;
320-
}
321-
322318
$primary-palette: generate-palette($primary, $saturations);
323319
$secondary-palette: generate-palette($secondary, $saturations);
324320
$grayscale-palette: grayscale-palette($grays, $shades);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,14 @@
8080
@mixin igx-core(
8181
$print-layout: true,
8282
$direction: ltr,
83-
$foreground-color: rgba(0, 0, 0, .87)
8483
) {
8584
@if $direction != ltr and $direction != rtl {
8685
$direction: ltr !global;
8786
} @else {
8887
$direction: $direction !global;
8988
}
9089

91-
$igx-foreground-color: $foreground-color !global;
92-
93-
@include igx-typography($base-color: $foreground-color);
90+
@include igx-typography();
9491
@include igx-vhelper();
9592

9693
@if $print-layout == true {

projects/igniteui-angular/src/lib/core/styles/typography/_typography.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
@mixin igx-typography(
4141
$font-family: "'Titillium Web', sans-serif",
4242
$type-scale: $default-type-scale,
43-
$base-color: $igx-foreground-color
4443
) {
4544
// Maps type scale typographic categories
4645
// to native elements.
@@ -64,7 +63,6 @@
6463
font-family: unquote($font-family);
6564
font-size: $browser-context;
6665
line-height: $browser-line-height;
67-
color: $base-color;
6866
font-size-adjust: 100%;
6967
-webkit-font-smoothing: antialiased;
7068
-moz-osx-font-smoothing: grayscale;

0 commit comments

Comments
 (0)