From: Jeremy Thomas Date: Sun, 2 Apr 2017 13:37:10 +0000 (+0100) Subject: Fix #578 X-Git-Tag: 0.4.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1f8e9ba1f0097ce1eba004da061b5bd293b74d0;p=thirdparty%2Fbulma.git Fix #578 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 3054246eb..a2cd2ffb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ # Fix #607 has-addons z-index # Feature #586 select color modifiers # Fix #537 -ms-expand +# Fix #578 better `+center` mixin ## 0.4.0 diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index 5b5e9a563..c2de947f1 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -1666,11 +1666,9 @@ a.box:active { height: 1em; position: relative; width: 1em; - left: 50%; - margin-left: -0.5em; - margin-top: -0.5em; position: absolute; - top: 50%; + left: calc(50% - (1em / 2)); + top: calc(50% - (1em / 2)); position: absolute !important; } diff --git a/sass/utilities/mixins.sass b/sass/utilities/mixins.sass index 1c1fd3080..8ac340c75 100644 --- a/sass/utilities/mixins.sass +++ b/sass/utilities/mixins.sass @@ -20,12 +20,14 @@ content: " " display: table -=center($size) - left: 50% - margin-left: -($size / 2) - margin-top: -($size / 2) +=center($width, $height: 0) position: absolute - top: 50% + @if $height != 0 + left: calc(50% - (#{$width} / 2)) + top: calc(50% - (#{$height} / 2)) + @else + left: calc(50% - (#{$width} / 2)) + top: calc(50% - (#{$width} / 2)) =delete +unselectable