From c9145afc26aff047fc9f748977ff6f81ff31a8cb Mon Sep 17 00:00:00 2001 From: Damian Keeghan Date: Mon, 16 Aug 2021 10:50:04 +1000 Subject: [PATCH] Removed / in scss and replaced with math.div() to support /'s deprecation in Dart SASS 2.0 --- README.md | 4 ++++ bower.json | 2 +- lib/dd.breakpoints.es6.js | 4 ++-- lib/dd.breakpoints.js | 4 ++-- lib/dd.breakpoints.less | 4 ++-- lib/dd.breakpoints.scss | 9 +++++---- package.json | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c2c3ca4..618d53f 100644 --- a/README.md +++ b/README.md @@ -707,6 +707,10 @@ Make sure to ensure that the values used here match the values used in the SCSS. ## Change log +`2.0.4` - Aug 2021 + +- Updated SCSS to support Dart SASS 2.0 by removing `a / b` and replacing with `math.div(a, b)`. + `2.0.3` - July 2020 - Updated JS library to support es6 while maintaining old version for backwards compatibility. Use `dd.breakpoints.es6.js` for the es6 version. diff --git a/bower.json b/bower.json index 0b7186b..aa5e362 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "DDBreakpoints", - "version": "2.0.3", + "version": "2.0.4", "homepage": "https://github.com/DeloitteDigitalAPAC/DDBreakpoints", "authors": [ "Deloitte Digital Australia" ], "description": "Breakpoints SCSS Mixin and JavaScript tool, used to accelerate the development process of responsive pages.", diff --git a/lib/dd.breakpoints.es6.js b/lib/dd.breakpoints.es6.js index 4024f04..aeef887 100644 --- a/lib/dd.breakpoints.es6.js +++ b/lib/dd.breakpoints.es6.js @@ -2,8 +2,8 @@ * Breakpoints for JavaScript (ES6). Works with the Deloitte Digital SCSS @bp mixin and Less .bp mixin * * @namespace DDBreakpoints - * @version 2.0.3 - * @copyright 2012-2020 Deloitte Digital Australia - http://www.deloittedigital.com/au + * @version 2.0.4 + * @copyright 2012-2021 Deloitte Digital Australia - http://www.deloittedigital.com/au * @author Deloitte Digital Australia deloittedigital@deloitte.com.au * @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) * diff --git a/lib/dd.breakpoints.js b/lib/dd.breakpoints.js index d269ecf..a187e81 100644 --- a/lib/dd.breakpoints.js +++ b/lib/dd.breakpoints.js @@ -3,8 +3,8 @@ * * @namespace bp * @memberof DD - * @version 2.0.3 - * @copyright 2012-2020 Deloitte Digital Australia - http://www.deloittedigital.com/au + * @version 2.0.4 + * @copyright 2012-2021 Deloitte Digital Australia - http://www.deloittedigital.com/au * @author Deloitte Digital Australia deloittedigital@deloitte.com.au * @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) */ diff --git a/lib/dd.breakpoints.less b/lib/dd.breakpoints.less index dc3bda4..9e8b42a 100644 --- a/lib/dd.breakpoints.less +++ b/lib/dd.breakpoints.less @@ -1,8 +1,8 @@ /** * Breakpoints for Less. Works with the Deloitte Digital DD.bp JavaScript * - * @version 2.0.3 - * @copyright 2012-2020 Deloitte Digital Australia - http://www.deloittedigital.com/au + * @version 2.0.4 + * @copyright 2012-2021 Deloitte Digital Australia - http://www.deloittedigital.com/au * @author Deloitte Digital Australia deloittedigital@deloitte.com.au * @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) */ diff --git a/lib/dd.breakpoints.scss b/lib/dd.breakpoints.scss index 933c6d9..9c701fa 100644 --- a/lib/dd.breakpoints.scss +++ b/lib/dd.breakpoints.scss @@ -1,13 +1,14 @@ /** * Breakpoints for SCSS. Works with the Deloitte Digital DD.bp JavaScript * - * @version 2.0.3 - * @copyright 2012-2020 Deloitte Digital Australia - http://www.deloittedigital.com/au + * @version 2.0.4 + * @copyright 2012-2021 Deloitte Digital Australia - http://www.deloittedigital.com/au * @author Deloitte Digital Australia deloittedigital@deloitte.com.au * @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) */ @use "sass:map"; +@use "sass:math"; // Global variables $is-responsive: true !default; // toggles if responsive stylesheets are required - used for outputting legacy non-responsive stylesheets using the same code @@ -80,7 +81,7 @@ $_breakpoints-max: _calc-max-bps(); $unit: 1rem; } - @return $number / ($number * 0 + 1) * $unit; + @return math.div($number, $number * 0 + 1) * $unit; } @else { @error "Expected number but was passed #{type_of($number)}: #{$number}"; } @@ -88,7 +89,7 @@ $_breakpoints-max: _calc-max-bps(); // Converts px to ems using the $base-font-size global variable @function _px-to-ems($px) { - @return $px / $base-font-size; + @return math.div($px, $base-font-size); } // Converts a bp name (e.g. l) to the px variable then to ems diff --git a/package.json b/package.json index 9434432..620b191 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deloitte-digital-au/ddbreakpoints", - "version": "2.0.3", + "version": "2.0.4", "description": "Breakpoints SCSS Mixin and JavaScript tool, used to accelerate the development process of responsive pages.", "main": "lib/dd.breakpoints.js", "dependencies": {},