Skip to content

Commit

Permalink
Removed / in scss and replaced with math.div() to support /'s depreca…
Browse files Browse the repository at this point in the history
…tion in Dart SASS 2.0
  • Loading branch information
dkeeghan committed Aug 16, 2021
1 parent 56b6998 commit c9145af
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
4 changes: 2 additions & 2 deletions lib/dd.breakpoints.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
* @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause)
*
Expand Down
4 changes: 2 additions & 2 deletions lib/dd.breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
* @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause)
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/dd.breakpoints.less
Original file line number Diff line number Diff line change
@@ -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 [email protected]
* @license BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause)
*/
Expand Down
9 changes: 5 additions & 4 deletions lib/dd.breakpoints.scss
Original file line number Diff line number Diff line change
@@ -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 [email protected]
* @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
Expand Down Expand Up @@ -80,15 +81,15 @@ $_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}";
}
}

// 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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {},
Expand Down

0 comments on commit c9145af

Please sign in to comment.