From 63d72d278ecb927f1b045743df094c6d0ca24fff Mon Sep 17 00:00:00 2001 From: Andrea Bergamasco Date: Thu, 17 Jun 2021 16:03:37 +0200 Subject: [PATCH 1/2] Replaced deprecated node-sass with sass, fixed deprecations in _mixins.scss (#1491) --- .gitignore | 3 ++- package.json | 8 ++++---- sass/abstracts/mixins/_mixins.scss | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 947204654f..47454686ef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ package-lock.json composer.lock style.css.map -.DS_Store \ No newline at end of file +.DS_Store +.idea/ diff --git a/package.json b/package.json index 88f2d537d6..bb59eb68cb 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "devDependencies": { "@wordpress/scripts": "^19.2.2", "dir-archiver": "^1.1.1", - "node-sass": "^7.0.1", - "rtlcss": "^3.5.0" + "rtlcss": "^3.5.0", + "sass": "^1.35.1" }, "rtlcssConfig": { "options": { @@ -36,8 +36,8 @@ "map": false }, "scripts": { - "watch": "node-sass sass/ -o ./ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w", - "compile:css": "node-sass sass/ -o ./ && stylelint '*.css' --fix || true && stylelint '*.css' --fix", + "watch": "sass sass/:./ --source-map --style expanded --indented -w", + "compile:css": "sass sass/:./ && stylelint *.css --fix || true && stylelint *.css --fix", "compile:rtl": "rtlcss style.css style-rtl.css", "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", "lint:js": "wp-scripts lint-js 'js/*.js'", diff --git a/sass/abstracts/mixins/_mixins.scss b/sass/abstracts/mixins/_mixins.scss index 860eefe861..76d987b636 100644 --- a/sass/abstracts/mixins/_mixins.scss +++ b/sass/abstracts/mixins/_mixins.scss @@ -1,3 +1,5 @@ +@use "sass:math"; + // Center block @mixin center-block { display: block; @@ -7,5 +9,5 @@ // Column width with margin @mixin column-width($numberColumns: 3) { - width: map-get($columns, $numberColumns) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); + width: map-get($columns, $numberColumns) - math.div(($columns__margin * ($numberColumns - 1)), $numberColumns); } From 78aa2fd8065c2eefd220e7b76a29908cdd6b30f7 Mon Sep 17 00:00:00 2001 From: Andrea Bergamasco Date: Fri, 21 Jan 2022 16:06:19 +0100 Subject: [PATCH 2/2] [Bugfix] removed --indented from 'watch' script, per @maeseoki --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb59eb68cb..f1a639de08 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "map": false }, "scripts": { - "watch": "sass sass/:./ --source-map --style expanded --indented -w", + "watch": "sass sass/:./ --source-map --style expanded -w", "compile:css": "sass sass/:./ && stylelint *.css --fix || true && stylelint *.css --fix", "compile:rtl": "rtlcss style.css style-rtl.css", "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'",