Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
v3.0.6 upgrade package to use sass instead of node-sass
Browse files Browse the repository at this point in the history
  • Loading branch information
xavianaxw committed Nov 4, 2021
1 parent 0e4008f commit 63a6a7e
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 836 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9.0
8.10.0
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@

## `[v3.0.5]`

- Add `font-display: swap`
- Add `font-display: swap`

## `[v3.0.6]`

- Fix `dart-sass` warning on division. Use `math.div` instead
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-fonts",
"version": "3.0.5",
"version": "3.0.6",
"description": "Helpers for Fonts - Google, Webfonts and Typekit!",
"main": "index.js",
"repository": "[email protected]:xavianaxw/sass-fonts.git",
Expand All @@ -21,13 +21,13 @@
"@hapi/hoek": "^8.2.4",
"glob": "^7.1.4",
"mocha": "^6.2.0",
"node-sass": "^4.12.0",
"sass": "^1.43.4",
"sass-true": "^5.0.0",
"stylelint": "^10.1.0",
"stylelint-scss": "^3.10.1",
"stylelint-suitcss": "^3.0.0"
},
"dependencies": {
"sass-mq": "^5.0.1"
"sass-mq": "^6.0.0-beta.1"
}
}
19 changes: 11 additions & 8 deletions test/_test.sf-typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
// Changelog
// 2.0.0 - created
// 3.0.0 - remove inuitcss as a dependency
// 3.0.6 - use sass:math.div() instead of standard / to divide numbers
// ==========================================================================||

@use "sass:math";

@import "true";
@import "../node_modules/sass-mq/mq";

Expand Down Expand Up @@ -54,13 +57,13 @@ $typographies: (
font-display: swap;
font-weight: 400;
font-size: 28px;
font-size: (28px / $sf-global-font-size) * 1rem;
font-size: math.div(28px, $sf-global-font-size) * 1rem;
line-height: 44px;
letter-spacing: 0.98px;

@media (min-width: 61.25em) {
font-size: 36px;
font-size: (36px / $sf-global-font-size) * 1rem;
font-size: math.div(36px, $sf-global-font-size) * 1rem;
line-height: 56px;
letter-spacing: 1.26px;
}
Expand All @@ -82,13 +85,13 @@ $typographies: (
font-display: swap;
font-weight: 300;
font-size: 18px;
font-size: (18px / $sf-global-font-size) * 1rem;
font-size: math.div(18px, $sf-global-font-size) * 1rem;
line-height: 30px;
letter-spacing: 0.6px;

@media (min-width: 61.25em) {
font-size: 20px;
font-size: (20px / $sf-global-font-size) * 1rem;
font-size: math.div(20px, $sf-global-font-size) * 1rem;
line-height: 32px;
letter-spacing: 0.7px;
}
Expand All @@ -110,13 +113,13 @@ $typographies: (
font-display: swap;
font-weight: 400 !important;
font-size: 28px !important;
font-size: (28px / $sf-global-font-size) * 1rem !important;
font-size: math.div(28px, $sf-global-font-size) * 1rem !important;
line-height: 44px !important;
letter-spacing: 0.98px !important;

@media (min-width: 61.25em) {
font-size: 36px !important;
font-size: (36px / $sf-global-font-size) * 1rem !important;
font-size: math.div(36px, $sf-global-font-size) * 1rem !important;
line-height: 56px !important;
letter-spacing: 1.26px !important;
}
Expand All @@ -138,13 +141,13 @@ $typographies: (
font-display: swap;
font-weight: 300 !important;
font-size: 18px !important;
font-size: (18px / $sf-global-font-size) * 1rem !important;
font-size: math.div(18px, $sf-global-font-size) * 1rem !important;
line-height: 30px !important;
letter-spacing: 0.6px !important;

@media (min-width: 61.25em) {
font-size: 20px !important;
font-size: (20px / $sf-global-font-size) * 1rem !important;
font-size: math.div(20px, $sf-global-font-size) * 1rem !important;
line-height: 32px !important;
letter-spacing: 0.7px !important;
}
Expand Down
2 changes: 1 addition & 1 deletion test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ var glob = require('glob');

// Run tests
glob.sync('test/_*.scss').forEach(function (file) {
sassTrue.runSass({ file: file }, { describe, it });
sassTrue.runSass({ file: file }, { sass: require('sass'), describe, it });
});
5 changes: 4 additions & 1 deletion tools/_tools.font-size.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
// Changelog
// 2.0.2 - created
// 3.0.0 - remove inuitcss as a dependency
// 3.0.6 - use sass:math.div() instead of standard / to divide numbers
// ==========================================================================||

@use "sass:math";

@mixin sf-font-size($font-size, $line-height: 1, $letter-spacing: 0px, $important: false) {
$impt: false;

Expand All @@ -25,7 +28,7 @@
@if (type-of($font-size) == number and unit($font-size) == "px") {
// Provides a 'px' fallback for old IEs not supporting 'rem' values
font-size: $font-size $important;
font-size: ($font-size / $sf-global-font-size) * 1rem $important;
font-size: math.div($font-size, $sf-global-font-size) * 1rem $important;
} @else {
@error "font-size value is invalid. Must be a integer pixel.";
}
Expand Down
Loading

0 comments on commit 63a6a7e

Please sign in to comment.