Skip to content

Commit 65ecb08

Browse files
crisbetommalerba
authored andcommitted
fix(typography): deprecation warning in latest sass version (#14673)
* Updates to the latest `node-sass` version. * Fixes the build not using the `node-sass` version from the package.json. * Fixes a deprecation warning from the latest SASS version when the consumer has configured a non-string `font-family` (e.g. `Helvetica Neue`). Fixes #14636.
1 parent 3c71348 commit 65ecb08

File tree

4 files changed

+45
-12
lines changed

4 files changed

+45
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"gulp-if": "^2.0.2",
9999
"gulp-markdown": "^1.2.0",
100100
"gulp-rename": "^1.2.2",
101-
"gulp-sass": "^3.1.0",
101+
"gulp-sass": "^4.0.2",
102102
"gulp-transform": "^2.0.0",
103103
"gulp-util": "^3.0.8",
104104
"hammerjs": "^2.0.8",
@@ -121,7 +121,7 @@
121121
"minimist": "^1.2.0",
122122
"mock-fs": "^4.7.0",
123123
"moment": "^2.18.1",
124-
"node-sass": "^4.9.3",
124+
"node-sass": "^4.11.0",
125125
"parse5": "^5.0.0",
126126
"protractor": "^5.4.1",
127127
"resolve-bin": "^0.4.0",

src/lib/core/typography/_typography-utils.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
$font-family: _mat-get-type-value($config, $level, font-family);
3232
}
3333

34-
@return if($font-family == null, $font-family, unquote($font-family));
34+
// Guard against unquoting non-string values, because it's deprecated.
35+
@return if(type-of($font-family) == string, unquote($font-family), $font-family);
3536
}
3637

3738
// Outputs the shorthand `font` CSS property, based on a set of typography values. Falls back to

tools/package-tools/gulp/build-scss-pipeline.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ import {buildConfig} from '../build-config';
44

55
// These imports lack of type definitions.
66
const gulpSass = require('gulp-sass');
7+
const nodeSass = require('node-sass');
78
const gulpIf = require('gulp-if');
89
const gulpCleanCss = require('gulp-clean-css');
910

1011
const sassIncludePaths = [
1112
join(buildConfig.projectDir, 'node_modules/')
1213
];
1314

15+
// Set the compiler to our version of `node-sass`, rather than the one that `gulp-sass` depends on.
16+
gulpSass.compiler = nodeSass;
17+
1418
/** Create a gulp task that builds SCSS files. */
1519
export function buildScssPipeline(sourceDir: string, minifyOutput = false) {
1620
return src(join(sourceDir, '**/*.scss'))

yarn.lock

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4921,14 +4921,17 @@ gulp-rename@^1.2.2:
49214921
resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd"
49224922
integrity sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==
49234923

4924-
gulp-sass@^3.1.0:
4925-
version "3.2.1"
4926-
resolved "https://registry.yarnpkg.com/gulp-sass/-/gulp-sass-3.2.1.tgz#2e3688a96fd8be1c0c01340750c191b2e79fab94"
4927-
integrity sha512-UATbRpSDsyXCnpYSPBUEvdvtSEzksJs7/oQ0CujIpzKqKrO6vlnYwhX2UTsGrf4rNLwqlSSaM271It0uHYvJ3Q==
4924+
gulp-sass@^4.0.2:
4925+
version "4.0.2"
4926+
resolved "https://registry.yarnpkg.com/gulp-sass/-/gulp-sass-4.0.2.tgz#cfb1e3eff2bd9852431c7ce87f43880807d8d505"
4927+
integrity sha512-q8psj4+aDrblJMMtRxihNBdovfzGrXJp1l4JU0Sz4b/Mhsi2DPrKFYCGDwjIWRENs04ELVHxdOJQ7Vs98OFohg==
49284928
dependencies:
4929-
gulp-util "^3.0"
4929+
chalk "^2.3.0"
49304930
lodash.clonedeep "^4.3.2"
49314931
node-sass "^4.8.3"
4932+
plugin-error "^1.0.1"
4933+
replace-ext "^1.0.0"
4934+
strip-ansi "^4.0.0"
49324935
through2 "^2.0.0"
49334936
vinyl-sourcemaps-apply "^0.2.0"
49344937

@@ -4940,7 +4943,7 @@ gulp-transform@^2.0.0:
49404943
gulp-util "^3.0.8"
49414944
lodash "^4.17.4"
49424945

4943-
gulp-util@*, gulp-util@^3.0, gulp-util@^3.0.0, gulp-util@^3.0.7, gulp-util@^3.0.8:
4946+
gulp-util@*, gulp-util@^3.0.0, gulp-util@^3.0.7, gulp-util@^3.0.8:
49444947
version "3.0.8"
49454948
resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f"
49464949
integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08=
@@ -7677,7 +7680,32 @@ node-releases@^1.0.5:
76777680
dependencies:
76787681
semver "^5.3.0"
76797682

7680-
node-sass@^4.8.3, node-sass@^4.9.0, node-sass@^4.9.3:
7683+
node-sass@^4.11.0:
7684+
version "4.11.0"
7685+
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.11.0.tgz#183faec398e9cbe93ba43362e2768ca988a6369a"
7686+
integrity sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==
7687+
dependencies:
7688+
async-foreach "^0.1.3"
7689+
chalk "^1.1.1"
7690+
cross-spawn "^3.0.0"
7691+
gaze "^1.0.0"
7692+
get-stdin "^4.0.1"
7693+
glob "^7.0.3"
7694+
in-publish "^2.0.0"
7695+
lodash.assign "^4.2.0"
7696+
lodash.clonedeep "^4.3.2"
7697+
lodash.mergewith "^4.6.0"
7698+
meow "^3.7.0"
7699+
mkdirp "^0.5.1"
7700+
nan "^2.10.0"
7701+
node-gyp "^3.8.0"
7702+
npmlog "^4.0.0"
7703+
request "^2.88.0"
7704+
sass-graph "^2.2.4"
7705+
stdout-stream "^1.4.0"
7706+
"true-case-path" "^1.0.2"
7707+
7708+
node-sass@^4.8.3, node-sass@^4.9.0:
76817709
version "4.10.0"
76827710
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.10.0.tgz#dcc2b364c0913630945ccbf7a2bbf1f926effca4"
76837711
integrity sha512-fDQJfXszw6vek63Fe/ldkYXmRYK/QS6NbvM3i5oEo9ntPDy4XX7BcKZyTKv+/kSSxRtXXc7l+MSwEmYc0CSy6Q==
@@ -8452,7 +8480,7 @@ [email protected]:
84528480
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
84538481
integrity sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=
84548482

8455-
8483+
[email protected], plugin-error@^1.0.1:
84568484
version "1.0.1"
84578485
resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c"
84588486
integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==
@@ -9195,7 +9223,7 @@ [email protected]:
91959223
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924"
91969224
integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=
91979225

9198-
9226+
[email protected], replace-ext@^1.0.0:
91999227
version "1.0.0"
92009228
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
92019229
integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=

0 commit comments

Comments
 (0)