Skip to content

Commit

Permalink
Merge branch 'release/v5.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bramsmulders committed Nov 10, 2021
2 parents 178895c + 2685b19 commit 6c88a4c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 5.3.0 - 10-november-2021

- Fixed a bug where `px` based media queries were not converted to `em`

## 5.2.0 - 03-november-2021

- Upgraded stylelint-config-supple to version 4
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@supple-kit/supple-css",
"version": "5.2.0",
"version": "5.3.0",
"description": "Reliable and testable Sass framework. Fluid, Variable, supple if you will",
"main": "index.scss",
"repository": "https://github.com/supple-kit/supple-css.git",
Expand Down
15 changes: 14 additions & 1 deletion settings/defaults/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,20 @@ $should-be-pixel-values: (
@each $key, $value in $should-be-pixel-values {
@if type-of($value) == number {
@if math.unit($value) != 'px' {
@error '`#{$key}: #{$value}` needs to be a pixel value.';
@error '`#{$key}: #{$value}` needs to be a pixel unit.';
}
} @else {
@error '`#{$key}: #{$value}` needs to be a number.';
}
}

/**
* check that breakpoints are defined in px or em
*/
@each $key, $value in $breakpoints {
@if type-of($value) == number {
@if math.unit($value) != 'px' and math.unit($value) != 'em' {
@error 'Breakpoint `#{$key}: #{$value}` needs to be a pixel or em unit.';
}
} @else {
@error '`#{$key}: #{$value}` needs to be a number.';
Expand Down
10 changes: 5 additions & 5 deletions tools/_internal/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@
$parsed-value: validate-query($value);

@if $parsed-value {
@if math.unit($parsed-value) == 'em' {
$min-w: $parsed-value;
} @else {
$resolved-value: $parsed-value;

@if math.unit($parsed-value) == 'px' {
@if $key == max-width or $key == max-height {
$parsed-value: $parsed-value - 1px;
}

$min-w: value-to-em($parsed-value);
$resolved-value: value-to-em($parsed-value);
}

$return: map.merge($return, ($key: $parsed-value));
$return: map.merge($return, ($key: $resolved-value));
}

@return $return;
Expand Down

0 comments on commit 6c88a4c

Please sign in to comment.