Skip to content

Commit

Permalink
Merge pull request #201 from red-freak/master
Browse files Browse the repository at this point in the history
moved sass-true to the dev dependencies again
  • Loading branch information
red-freak authored Aug 27, 2023
2 parents b8b3980 + cce0617 commit b452406
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 22 deletions.
16 changes: 8 additions & 8 deletions functions/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@use "sass:math";
@use "sass:string";
@use "./type-checking" as check;
@use "../node_modules/sass-true/sass/throw" as throw;
@use "../helpers" as helpers;

$is-test: false !default;

Expand Down Expand Up @@ -111,25 +111,25 @@ $is-test: false !default;
$color2-peak: 11,
) {
@if check.is-color($color1) == false {
@return throw.error("❌ ===> The color1 parameter must be a color.", $catch: $is-test);
@return helpers.error("❌ ===> The color1 parameter must be a color.", $catch: $is-test);
}
@if check.is-color($color2) == false {
@return throw.error("❌ ===> The color2 parameter must be a color.", $catch: $is-test);
@return helpers.error("❌ ===> The color2 parameter must be a color.", $catch: $is-test);
}
@if check.is-color($color3) == false {
@return throw.error("❌ ===> The color3 parameter must be a color.", $catch: $is-test);
@return helpers.error("❌ ===> The color3 parameter must be a color.", $catch: $is-test);
}
@if check.is-integer($steps) == false {
@return throw.error("❌ ===> The steps parameter must be an integer.", $catch: $is-test);
@return helpers.error("❌ ===> The steps parameter must be an integer.", $catch: $is-test);
}
@if check.is-integer($color2-peak) == false {
@return throw.error("❌ ===> The color2-peak parameter must be an integer.", $catch: $is-test);
@return helpers.error("❌ ===> The color2-peak parameter must be an integer.", $catch: $is-test);
}
@if $color2-peak > $steps {
@return throw.error("❌ ===> The peak point for color2 must be less than or equal to the number of steps.", $catch: $is-test);
@return helpers.error("❌ ===> The peak point for color2 must be less than or equal to the number of steps.", $catch: $is-test);
}
@if $color2-peak < 1 {
@return throw.error("❌ ===> The peak point for color2 must be greater than or equal to 1.", $catch: $is-test);
@return helpers.error("❌ ===> The peak point for color2 must be greater than or equal to 1.", $catch: $is-test);
}

$color-map: (1: $color1);
Expand Down
11 changes: 11 additions & 0 deletions helpers/_error.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$is-test: false !default;

/// Use the throw.error() function outside of development mode.
/// @see node_modules/sass-true/sass/config/_throw.scss:70
@function error($message, $source: null, $catch: $is-test) {
@if $catch {
@return '#{if($source, 'ERROR [#{$source}]:', 'ERROR:')} #{$message}';
} @else {
@error $message;
}
}
1 change: 1 addition & 0 deletions helpers/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@forward 'error';
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
"email": "[email protected]",
"url": "https://webshaped.de"
},
"contributors": [
{
"name": "Felix Scholze",
"email": "[email protected]",
"url": "https://webshaped.de"
},
{
"name": "Sven George",
"url": "https://github.com/red-freak"
}
],
"funding": [
{
"type": "GitHub Sponsors",
Expand Down Expand Up @@ -80,6 +91,7 @@
"postcss": "^8.4.28",
"postcss-scss": "^4.0.7",
"sass": "^1.66.1",
"sass-true": "^7.0.0",
"sassdoc": "^2.7.4",
"semantic-release": "^21.1.1",
"stylelint": "^15.10.3",
Expand All @@ -88,8 +100,5 @@
"stylelint-config-standard-scss": "^10.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.7.0",
"stylelint-order": "^6.0.3"
},
"dependencies": {
"sass-true": "^7.0.0"
}
}
Loading

0 comments on commit b452406

Please sign in to comment.