forked from gridstack/gridstack.js
/
gridstack.scss
140 lines (118 loc) · 5.82 KB
/
gridstack.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/**
* gridstack SASS styles 6.0.2-dev
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/
@use "sass:math";
$gridstack-columns: 12 !default;
$animation_speed: .3s !default;
@mixin vendor($property, $value...){
-webkit-#{$property}: $value;
-moz-#{$property}: $value;
-ms-#{$property}: $value;
-o-#{$property}: $value;
#{$property}: $value;
}
:root .grid-stack-item > .ui-resizable-handle { filter: none; }
.grid-stack {
position: relative;
&.grid-stack-rtl {
direction: ltr;
> .grid-stack-item {
direction: rtl;
}
}
.grid-stack-placeholder > .placeholder-content {
background-color: rgba(0,0,0,0.1);
margin: 0;
position: absolute;
width: auto;
z-index: 0 !important;
text-align: center;
}
> .grid-stack-item {
min-width: math.div(100%, $gridstack-columns);
position: absolute;
padding: 0;
> .grid-stack-item-content {
margin: 0;
position: absolute;
width: auto;
overflow-x: hidden;
overflow-y: auto;
}
> .ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
&.ui-resizable-disabled > .ui-resizable-handle,
&.ui-resizable-autohide > .ui-resizable-handle { display: none; }
> .ui-resizable-se,
> .ui-resizable-sw {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSW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1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);
background-repeat: no-repeat;
background-position: center;
@include vendor(transform, rotate(45deg));
}
> .ui-resizable-se {
@include vendor(transform, rotate(-45deg));
}
> .ui-resizable-nw { cursor: nw-resize; width: 20px; height: 20px; top: 0; }
> .ui-resizable-n { cursor: n-resize; height: 10px; top: 0; left: 25px; right: 25px; }
> .ui-resizable-ne { cursor: ne-resize; width: 20px; height: 20px; top: 0; }
> .ui-resizable-e { cursor: e-resize; width: 10px; top: 15px; bottom: 15px; }
> .ui-resizable-se { cursor: se-resize; width: 20px; height: 20px;}
> .ui-resizable-s { cursor: s-resize; height: 10px; left: 25px; bottom: 0; right: 25px; }
> .ui-resizable-sw { cursor: sw-resize; width: 20px; height: 20px;}
> .ui-resizable-w { cursor: w-resize; width: 10px; top: 15px; bottom: 15px; }
&.ui-draggable-dragging {
&> .ui-resizable-handle {
display: none !important;
}
}
@for $i from 0 through $gridstack-columns {
&[gs-w='#{$i}'] { width: math.div(100%, $gridstack-columns) * $i; }
&[gs-x='#{$i}'] { left: math.div(100%, $gridstack-columns) * $i; }
&[gs-min-w='#{$i}'] { min-width: math.div(100%, $gridstack-columns) * $i; }
&[gs-max-w='#{$i}'] { max-width: math.div(100%, $gridstack-columns) * $i; }
}
}
&.grid-stack-1>.grid-stack-item {
min-width: 100%;
&[gs-w='1'] { width: 100%; }
&[gs-x='1'] { left: 100%; }
&[gs-min-w='1'] { min-width: 100%; }
&[gs-max-w='1'] { max-width: 100%; }
}
&.grid-stack-animate,
&.grid-stack-animate .grid-stack-item {
@include vendor(transition, left $animation_speed, top $animation_speed, height $animation_speed, width $animation_speed);
}
&.grid-stack-animate .grid-stack-item.ui-draggable-dragging,
&.grid-stack-animate .grid-stack-item.ui-resizable-resizing,
&.grid-stack-animate .grid-stack-item.grid-stack-placeholder{
@include vendor(transition, left 0s, top 0s, height 0s, width 0s);
}
// without this, the html5 drag will flicker between no-drop and drop when dragging over second grid
// Update: removed that as it causes nested grids to no receive dragenter events when parent drags and sets this for #992. not seeing cursor flicker (chrome).
// &.ui-droppable.ui-droppable-over > *:not(.ui-droppable) {
// pointer-events: none;
// }
}
.ui-draggable-dragging,
.ui-resizable-resizing {
z-index: 100;
> .grid-stack-item-content {
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
opacity: 0.8;
}
}
.ui-draggable-dragging {
will-change: left, top;
cursor: move;
}
.ui-resizable-resizing {
will-change: width, height;
}