From a2b9e037506370ad43e3faff22db07ddb8cf4ee8 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sun, 30 Apr 2023 17:15:26 -0700 Subject: [PATCH] more CSS tweaks --- README.md | 2 +- src/gridstack-extra.scss | 15 ++++++--------- src/gridstack.scss | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ef55f3fa8..f889e3605 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ Better yet, here is a SASS code snippet, you can use sites like [sassmeister.com ```sass $columns: 12; @function fixed($float) { - @return calc(round($float * 1000) / 1000); + @return calc(round($float * 100) / 100); // total 4 digits being % } .grid-stack-#{$columns} > .grid-stack-item { diff --git a/src/gridstack-extra.scss b/src/gridstack-extra.scss index 52f5f6d84..906bbb48b 100644 --- a/src/gridstack-extra.scss +++ b/src/gridstack-extra.scss @@ -6,19 +6,16 @@ $gridstack-columns-start: 2 !default; $gridstack-columns: 11 !default; @function fixed($float) { - @return calc(round($float * 1000) / 1000); + @return calc(round($float * 100) / 100); // total 4 digits being % } @mixin grid-stack-items($columns) { - .grid-stack-#{$columns} { + .grid-stack-#{$columns} > .grid-stack-item { + min-width: fixed(calc(100% / $columns)); - > .grid-stack-item { - min-width: fixed(calc(100% / $columns)); - - @for $i from 1 through $columns - 1 { - &[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); } - &[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); } - } + @for $i from 1 through $columns - 1 { + &[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); } + &[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); } } } } diff --git a/src/gridstack.scss b/src/gridstack.scss index 74a6f20f6..afa00ead2 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -7,7 +7,7 @@ $columns: 12 !default; $animation_speed: .3s !default; @function fixed($float) { - @return calc(round($float * 1000) / 1000); + @return calc(round($float * 100) / 100); // total 4 digits being % } @mixin vendor($property, $value...){