Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83b0bc4

Browse files
authored
Merge pull request gridstack#2298 from adumesny/master
more CSS tweaks
2 parents 73287e5 + a2b9e03 commit 83b0bc4

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Better yet, here is a SASS code snippet, you can use sites like [sassmeister.com
250250
```sass
251251
$columns: 12;
252252
@function fixed($float) {
253-
@return calc(round($float * 1000) / 1000);
253+
@return calc(round($float * 100) / 100); // total 4 digits being %
254254
}
255255
.grid-stack-#{$columns} > .grid-stack-item {
256256

src/gridstack-extra.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ $gridstack-columns-start: 2 !default;
66
$gridstack-columns: 11 !default;
77

88
@function fixed($float) {
9-
@return calc(round($float * 1000) / 1000);
9+
@return calc(round($float * 100) / 100); // total 4 digits being %
1010
}
1111

1212
@mixin grid-stack-items($columns) {
13-
.grid-stack-#{$columns} {
13+
.grid-stack-#{$columns} > .grid-stack-item {
14+
min-width: fixed(calc(100% / $columns));
1415

15-
> .grid-stack-item {
16-
min-width: fixed(calc(100% / $columns));
17-
18-
@for $i from 1 through $columns - 1 {
19-
&[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); }
20-
&[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); }
21-
}
16+
@for $i from 1 through $columns - 1 {
17+
&[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); }
18+
&[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); }
2219
}
2320
}
2421
}

src/gridstack.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $columns: 12 !default;
77
$animation_speed: .3s !default;
88

99
@function fixed($float) {
10-
@return calc(round($float * 1000) / 1000);
10+
@return calc(round($float * 100) / 100); // total 4 digits being %
1111
}
1212

1313
@mixin vendor($property, $value...){

0 commit comments

Comments
 (0)