Skip to content

Commit f774a3a

Browse files
authored
feat: Update to SASS 1.65 (#14)
## Description Updates to SASS 1.65 and resolves a conflict in function naming: the rem() function, and mixin, have been renamed as 'toRem' to avoid using 'rem' as that is now a reserved function. ## Issue https://jira.dev.bbc.co.uk/browse/GEL-2103
1 parent 30e5dba commit f774a3a

File tree

5 files changed

+180
-83
lines changed

5 files changed

+180
-83
lines changed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.17.1

lib/tools/_rem.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $gel-tools-rem-enable--fallback: true !default;
2626
//
2727
// @author Kaelig - https://github.com/guardian/guss-rem
2828
//
29-
@function rem($value, $baseline: $gel-base-font-size) {
29+
@function toRem($value, $baseline: $gel-base-font-size) {
3030

3131
// if function is disabled then return the value
3232
@if ($gel-tools-rem-enable--function == false) {
@@ -61,7 +61,7 @@ $gel-tools-rem-enable--fallback: true !default;
6161
//
6262
// @author Shaun Bent
6363
//
64-
@mixin rem($property, $value) {
64+
@mixin toRem($property, $value) {
6565

6666
// Return the pixel value first
6767
@if ($gel-tools-rem-enable--mixin == false or $gel-tools-rem-enable--fallback == true) {
@@ -70,7 +70,7 @@ $gel-tools-rem-enable--fallback: true !default;
7070

7171
// Pass the px value into the rem function
7272
@if ($gel-tools-rem-enable--function == true and $gel-tools-rem-enable--mixin == true) {
73-
#{$property}: rem($value);
73+
#{$property}: toRem($value);
7474
}
7575

7676
}

package-lock.json

+166-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gel-sass-tools",
3-
"version": "2.1.0",
3+
"version": "3.0.0",
44
"description": "A collection of Sass Settings & Tools which align to key GEL values",
55
"main": "_sass-tools.scss",
66
"scripts": {
@@ -34,10 +34,10 @@
3434
},
3535
"homepage": "https://github.com/bbc/gel-sass-tools",
3636
"dependencies": {
37-
"sass-mq": "5.0.1"
37+
"sass-mq": "6.0.0"
3838
},
3939
"devDependencies": {
40-
"sass": "1.42.1",
41-
"sass-mq": "5.0.1"
40+
"sass": "1.65.1",
41+
"sass-mq": "6.0.0"
4242
}
4343
}

test/test.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
// Lets test our rem functions
2626
.rem-function {
27-
font-size: rem(16px); // Expected: 1rem
28-
font-size: rem(24px); // Expected: 1.5rem
29-
font-size: rem(32px); // Expected: 2rem
27+
font-size: toRem(16px); // Expected: 1rem
28+
font-size: toRem(24px); // Expected: 1.5rem
29+
font-size: toRem(32px); // Expected: 2rem
3030
}
3131

3232
.rem-mixin {
33-
@include rem('font-size', 16px); // Expected: 1rem
34-
@include rem('font-size', 24px); // Expected: 1.5rem
35-
@include rem('font-size', 32px); // Expected: 2rem
33+
@include toRem('font-size', 16px); // Expected: 1rem
34+
@include toRem('font-size', 24px); // Expected: 1.5rem
35+
@include toRem('font-size', 32px); // Expected: 2rem
3636
}
3737

3838
// Lets test RTL support

0 commit comments

Comments
 (0)