33 * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
44 */
55
6- $animation_speed : .3s !default ;
7-
8- @function fixed ($float ) {
9- @return calc (round ($float * 1000 ) / 1000 ); // total 4-5 digits being %
10- }
11-
12- @mixin vendor ($property , $value ...){
13- // -webkit-#{$property}: $value;
14- // -moz-#{$property}: $value;
15- // -ms-#{$property}: $value;
16- // -o-#{$property}: $value;
17- #{$property } : $value ;
18- }
19-
20- .grid-stack {
21- position : relative ;
22- }
23-
24- .grid-stack-rtl {
25- direction : ltr ;
26- > .grid-stack-item {
27- direction : rtl ;
28- }
29- }
30-
31- .grid-stack-placeholder > .placeholder-content {
32- background-color : rgba (0 ,0 ,0 ,0.1 );
33- margin : 0 ;
34- position : absolute ;
35- width : auto ;
36- z-index : 0 !important ;
37- }
38-
39- // make those more unique as to not conflict with side panel items
40- .grid-stack > .grid-stack-item {
41- position : absolute ;
42- padding : 0 ;
43- top : 0 ; left : 0 ; // some default to reduce at least first row/column inline styles
44- width : var (--gs-column-width ); // reduce 1x1 items inline styles
45- height : var (--gs-cell-height );
46-
47- > .grid-stack-item-content {
48- margin : 0 ;
49- position : absolute ;
50- width : auto ;
51- overflow-x : hidden ;
52- overflow-y : auto ;
53- }
54- & .size-to-content :not (.size-to-content-max ) > .grid-stack-item-content {
55- overflow-y : hidden ;
56- }
57- }
58-
59- .grid-stack {
60- > .grid-stack-item > .grid-stack-item-content ,
61- > .grid-stack-placeholder > .placeholder-content {
62- top : var (--gs-item-margin-top );
63- right : var (--gs-item-margin-right );
64- bottom : var (--gs-item-margin-bottom );
65- left : var (--gs-item-margin-left );
66- }
67- }
68-
69- .grid-stack-item {
70- > .ui-resizable-handle {
71- position : absolute ;
72- font-size : 0.1px ;
73- display : block ;
74- -ms-touch-action : none ;
75- touch-action : none ;
76- }
77-
78- & .ui-resizable-disabled > .ui-resizable-handle ,
79- & .ui-resizable-autohide > .ui-resizable-handle { display : none ; }
80-
81- > .ui-resizable-ne ,
82- > .ui-resizable-nw ,
83- > .ui-resizable-se ,
84- > .ui-resizable-sw {
85- background-image : url (' data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="%23666" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 20 20"><path d="m10 3 2 2H8l2-2v14l-2-2h4l-2 2"/></svg>' );
86- background-repeat : no-repeat ;
87- background-position : center ;
88- }
89-
90- > .ui-resizable-ne {
91- @include vendor (transform , rotate (45deg ));
92- }
93- > .ui-resizable-sw {
94- @include vendor (transform , rotate (45deg ));
95- }
96-
97- > .ui-resizable-nw {
98- @include vendor (transform , rotate (-45deg ));
99- }
100- > .ui-resizable-se {
101- @include vendor (transform , rotate (-45deg ));
102- }
103-
104- > .ui-resizable-nw { cursor : nw-resize ; width : 20px ; height : 20px ; top : var (--gs-item-margin-top ); left : var (--gs-item-margin-left ); }
105- > .ui-resizable-n { cursor : n-resize ; height : 10px ; top : var (--gs-item-margin-top ); left : 25px ; right : 25px ; }
106- > .ui-resizable-ne { cursor : ne-resize ; width : 20px ; height : 20px ; top : var (--gs-item-margin-top ); right : var (--gs-item-margin-right ); }
107- > .ui-resizable-e { cursor : e-resize ; width : 10px ; top : 15px ; bottom : 15px ; right : var (--gs-item-margin-right );}
108- > .ui-resizable-se { cursor : se-resize ; width : 20px ; height : 20px ; bottom : var (--gs-item-margin-bottom ); right : var (--gs-item-margin-right ); }
109- > .ui-resizable-s { cursor : s-resize ; height : 10px ; left : 25px ; bottom : var (--gs-item-margin-bottom ); right : 25px ; }
110- > .ui-resizable-sw { cursor : sw-resize ; width : 20px ; height : 20px ; bottom : var (--gs-item-margin-bottom ); left : var (--gs-item-margin-left ); }
111- > .ui-resizable-w { cursor : w-resize ; width : 10px ; top : 15px ; bottom : 15px ; left : var (--gs-item-margin-left ); }
112-
113- & .ui-draggable-dragging {
114- & > .ui-resizable-handle {
115- display : none !important ;
116- }
117- }
118-
119- & .ui-draggable-dragging {
120- will-change : left , top ;
121- }
122-
123- & .ui-resizable-resizing {
124- will-change : width , height ;
125- }
126- }
127-
128- // not .grid-stack-item specific to also affect dragIn regions
129- .ui-draggable-dragging ,
130- .ui-resizable-resizing {
131- z-index : 10000 ; // bootstrap modal has a z-index of 1050
132-
133- > .grid-stack-item-content {
134- box-shadow : 1px 4px 6px rgba (0 , 0 , 0 , 0.2 );
135- opacity : 0.8 ;
136- }
137- }
138-
139- .grid-stack-animate ,
140- .grid-stack-animate .grid-stack-item {
141- @include vendor (transition , left $animation_speed , top $animation_speed , height $animation_speed , width $animation_speed );
142- }
143-
144- .grid-stack-animate .grid-stack-item.ui-draggable-dragging ,
145- .grid-stack-animate .grid-stack-item.ui-resizable-resizing ,
146- .grid-stack-animate .grid-stack-item.grid-stack-placeholder {
147- @include vendor (transition , left 0s , top 0s , height 0s , width 0s );
148- }
149-
150- // make those more unique as to not conflict with side panel items, but apply to all column layouts (so not in loop below)
151- .grid-stack > .grid-stack-item [gs-y = " 0" ] {
152- top : 0px ;
153- }
154- .grid-stack > .grid-stack-item [gs-x = " 0" ] {
155- left : 0% ;
156- }
157-
6+ $animation_speed : .3s !default ;
7+
8+ .grid-stack {
9+ position : relative ;
10+ }
11+
12+ .grid-stack-rtl {
13+ direction : ltr ;
14+ > .grid-stack-item {
15+ direction : rtl ;
16+ }
17+ }
18+
19+ .grid-stack-placeholder > .placeholder-content {
20+ background-color : rgba (0 ,0 ,0 ,0.1 );
21+ margin : 0 ;
22+ position : absolute ;
23+ width : auto ;
24+ z-index : 0 !important ;
25+ }
26+
27+ // make those more unique as to not conflict with side panel items
28+ .grid-stack > .grid-stack-item {
29+ position : absolute ;
30+ padding : 0 ;
31+ top : 0 ; left : 0 ; // some default to reduce at least first row/column inline styles
32+ width : var (--gs-column-width ); // reduce 1x1 items inline styles
33+ height : var (--gs-cell-height );
34+
35+ > .grid-stack-item-content {
36+ margin : 0 ;
37+ position : absolute ;
38+ width : auto ;
39+ overflow-x : hidden ;
40+ overflow-y : auto ;
41+ }
42+ & .size-to-content :not (.size-to-content-max ) > .grid-stack-item-content {
43+ overflow-y : hidden ;
44+ }
45+ }
46+
47+ .grid-stack {
48+ > .grid-stack-item > .grid-stack-item-content ,
49+ > .grid-stack-placeholder > .placeholder-content {
50+ top : var (--gs-item-margin-top );
51+ right : var (--gs-item-margin-right );
52+ bottom : var (--gs-item-margin-bottom );
53+ left : var (--gs-item-margin-left );
54+ }
55+ }
56+
57+ .grid-stack-item {
58+ > .ui-resizable-handle {
59+ position : absolute ;
60+ font-size : 0.1px ;
61+ display : block ;
62+ -ms-touch-action : none ;
63+ touch-action : none ;
64+ }
65+
66+ & .ui-resizable-disabled > .ui-resizable-handle ,
67+ & .ui-resizable-autohide > .ui-resizable-handle { display : none ; }
68+
69+ > .ui-resizable-ne ,
70+ > .ui-resizable-nw ,
71+ > .ui-resizable-se ,
72+ > .ui-resizable-sw {
73+ background-image : url (' data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="%23666" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 20 20"><path d="m10 3 2 2H8l2-2v14l-2-2h4l-2 2"/></svg>' );
74+ background-repeat : no-repeat ;
75+ background-position : center ;
76+ }
77+
78+ > .ui-resizable-ne {
79+ transform : rotate (45deg );
80+ }
81+ > .ui-resizable-sw {
82+ transform : rotate (45deg );
83+ }
84+
85+ > .ui-resizable-nw {
86+ transform : rotate (-45deg );
87+ }
88+ > .ui-resizable-se {
89+ transform : rotate (-45deg );
90+ }
91+
92+ > .ui-resizable-nw { cursor : nw-resize ; width : 20px ; height : 20px ; top : var (--gs-item-margin-top ); left : var (--gs-item-margin-left ); }
93+ > .ui-resizable-n { cursor : n-resize ; height : 10px ; top : var (--gs-item-margin-top ); left : 25px ; right : 25px ; }
94+ > .ui-resizable-ne { cursor : ne-resize ; width : 20px ; height : 20px ; top : var (--gs-item-margin-top ); right : var (--gs-item-margin-right ); }
95+ > .ui-resizable-e { cursor : e-resize ; width : 10px ; top : 15px ; bottom : 15px ; right : var (--gs-item-margin-right );}
96+ > .ui-resizable-se { cursor : se-resize ; width : 20px ; height : 20px ; bottom : var (--gs-item-margin-bottom ); right : var (--gs-item-margin-right ); }
97+ > .ui-resizable-s { cursor : s-resize ; height : 10px ; left : 25px ; bottom : var (--gs-item-margin-bottom ); right : 25px ; }
98+ > .ui-resizable-sw { cursor : sw-resize ; width : 20px ; height : 20px ; bottom : var (--gs-item-margin-bottom ); left : var (--gs-item-margin-left ); }
99+ > .ui-resizable-w { cursor : w-resize ; width : 10px ; top : 15px ; bottom : 15px ; left : var (--gs-item-margin-left ); }
100+
101+ & .ui-draggable-dragging {
102+ & > .ui-resizable-handle {
103+ display : none !important ;
104+ }
105+ }
106+
107+ & .ui-draggable-dragging {
108+ will-change : left , top ;
109+ }
110+
111+ & .ui-resizable-resizing {
112+ will-change : width , height ;
113+ }
114+ }
115+
116+ // not .grid-stack-item specific to also affect dragIn regions
117+ .ui-draggable-dragging ,
118+ .ui-resizable-resizing {
119+ z-index : 10000 ; // bootstrap modal has a z-index of 1050
120+
121+ > .grid-stack-item-content {
122+ box-shadow : 1px 4px 6px rgba (0 , 0 , 0 , 0.2 );
123+ opacity : 0.8 ;
124+ }
125+ }
126+
127+ .grid-stack-animate ,
128+ .grid-stack-animate .grid-stack-item {
129+ transition : left $animation_speed , top $animation_speed , height $animation_speed , width $animation_speed ;
130+ }
131+
132+ .grid-stack-animate .grid-stack-item.ui-draggable-dragging ,
133+ .grid-stack-animate .grid-stack-item.ui-resizable-resizing ,
134+ .grid-stack-animate .grid-stack-item.grid-stack-placeholder {
135+ transition : left 0s , top 0s , height 0s , width 0s ;
136+ }
137+
138+ // make those more unique as to not conflict with side panel items, but apply to all column layouts (so not in loop below)
139+ .grid-stack > .grid-stack-item [gs-y = " 0" ] {
140+ top : 0px ;
141+ }
142+ .grid-stack > .grid-stack-item [gs-x = " 0" ] {
143+ left : 0% ;
144+ }
145+
146+
0 commit comments