Skip to content

Commit

Permalink
box-size fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Black Mirror committed Feb 15, 2018
1 parent b99c524 commit 4feb40e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Flavor SCSS, bourbon.io based mixins & helpers",
"main": "scss/flavor.scss",
"scripts": {
"pretest": "changelog && npm run readme",
"readme": "pkg-2-readme package.json > README.md -t \"./pkg-2-readme.template.md\" && echo 'README.md file built'",
"test": "sass-lint -c scss-lint.yml -v -q"
},
Expand All @@ -30,4 +31,4 @@
"bourbon": "^5.0.0",
"sass-lint": "^1.12.1"
}
}
}
15 changes: 13 additions & 2 deletions scss/mixins/_box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ $bound-box-sizes: array-append((none), $css-default-modes);
-moz-box-shadow: $shadows;
box-shadow: $shadows;
}
@mixin box-size($options, $height-fallback: true) {
$settings: ( width: null, height: null, min-width: null, min-height: null, max-width: null, max-height: null );
@mixin box-size($options) {
$settings: (
width: null,
height: null,
min-width: null,
min-height: null,
max-width: null,
max-height: null
height-fallback: true
);

@if is-object($options) {
$settings:extend($settings, $options);
}
Expand Down Expand Up @@ -72,6 +81,8 @@ $bound-box-sizes: array-append((none), $css-default-modes);
}
}

$height-fallback: map-get($settings, height-fallback);

$height: map-get($settings, height);
@if $height-fallback == true and is-defined($width) and not is-defined($height) {
$height: $width;
Expand Down

0 comments on commit 4feb40e

Please sign in to comment.