-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement Suggestion #81
Comments
I've update README with your snippet. Thank you. |
Late to the conversation but you might also want to have the width variable, either in percentage or pixels, since being responsive and fluid not always works hand to hand... One thing is to have a responsive container, and another one is to have a responsive widget so sometimes having pixel dimensions is not a bad idea. So if you put that logic inside a media query you can have different pixel/percentage based widgets sizes. $gridstack-columns: 12;
$resolution: 1440px;
@media (min-width: 1440px) {
.container {
.grid-stack {
.grid-stack-item {
position: absolute !important;
@for $i from 1 through $gridstack-columns {
&[data-gs-width='#{$i}'] { width: ($resolution / $gridstack-columns) * $i; }
&[data-gs-x='#{$i}'] { left: ($resolution / $gridstack-columns) * $i; }
&.grid-stack-item[data-gs-min-width='#{$i}'] { min-width: ($resolution / $gridstack-columns) * $i; }
&.grid-stack-item[data-gs-max-width='#{$i}'] { max-width: ($resolution / $gridstack-columns) * $i; }
}
}
}
}
} |
Here is a less css version: @columns: 6;
.gs-item(@n) when (@n > 0) {
.gs-item(@n - 1);
&[data-gs-width="@{n}"] { width: (100% / @columns) * @n; }
&[data-gs-x="@{n}"] { left: (100% / @columns) * @n; }
&[data-gs-min-width="@{n}"] { min-width: (100% / @columns) * @n; }
&[data-gs-max-width="@{n}"] { max-width: (100% / @columns) * @n; }
}
.grid-stack-item {
.gs-item(@columns);
} |
@ascendantofrain @cspeer @troolee @radiolips does this still work ? |
@mandys @ascendantofrain I think it's because of core gridstack.css styles. You must override them: .grid-stack > .grid-stack-item {
$gridstack-columns: 200;
@for $i from 1 through $gridstack-columns {
&[data-gs-width='#{$i}'] { width: (100% / $gridstack-columns) * $i; }
&[data-gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; }
&.grid-stack-item[data-gs-min-width='#{$i}'] { min-width: (100% / $gridstack-columns) * $i; }
&.grid-stack-item[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; }
}
} But I couldn't solve the overlapping items problem yet. |
I had to add the
|
Just a little something I made for my own project using this framework.
I use SASS with my application and using this little snippet makes adjusting grids MUCH easier.
The text was updated successfully, but these errors were encountered: