Skip to content

Commit c1e65a8

Browse files
committed
fixed resizing for safari
Signed-off-by: Maximilian Inckmann <[email protected]>
1 parent c833c6a commit c1e65a8

File tree

2 files changed

+70
-35
lines changed

2 files changed

+70
-35
lines changed

packages/stencil-library/src/components/pid-collapsible/collapsible.css

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ pid-collapsible.resize-both {
5454
-webkit-resize: both !important;
5555
resize: both !important;
5656
overflow: auto !important;
57+
position: relative !important;
58+
}
59+
60+
/* Enhanced resize handle for Safari */
61+
pid-collapsible.resize-both::after {
62+
content: '';
63+
position: absolute;
64+
bottom: 0;
65+
right: 0;
66+
width: 15px;
67+
height: 15px;
68+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 2L2 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 8L8 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 14L14 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
69+
background-repeat: no-repeat;
70+
background-position: bottom right;
71+
cursor: nwse-resize;
72+
z-index: 10;
73+
pointer-events: none;
5774
}
5875
}
5976
}
@@ -68,11 +85,14 @@ pid-collapsible.resize-both::after {
6885
position: absolute;
6986
bottom: 0;
7087
right: 0;
71-
width: 10px;
72-
height: 10px;
88+
width: 15px;
89+
height: 15px;
7390
cursor: nwse-resize;
74-
background: linear-gradient(-45deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 50%, transparent 50%);
91+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 2L2 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 8L8 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 14L14 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
92+
background-repeat: no-repeat;
93+
background-position: bottom right;
7594
z-index: 10; /* Ensure resize handle is above other elements */
95+
pointer-events: none;
7696
}
7797

7898
/*
@@ -148,36 +168,34 @@ pid-collapsible.resize-both::after {
148168
visibility: hidden;
149169
}
150170

151-
/*!* Ensure resize works in Safari *!*/
152-
/*pid-collapsible.resize-both {*/
153-
/* position: relative;*/
154-
/* -webkit-resize: both !important;*/
155-
/* resize: both !important;*/
156-
/* overflow: auto !important;*/
157-
/* max-width: 100% !important;*/
158-
/* max-height: 90vh !important;*/
159-
/* display: block !important;*/
160-
/*}*/
161-
/*!* Enhanced resize handle visibility for Safari *!*/
162-
/*pid-collapsible.resize-both::after {*/
163-
/* content: '';*/
164-
/* position: absolute;*/
165-
/* bottom: 0;*/
166-
/* right: 0;*/
167-
/* width: 15px;*/
168-
/* height: 15px;*/
169-
/* cursor: nwse-resize;*/
170-
/* background: linear-gradient(-45deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 50%);*/
171-
/* z-index: 10;*/
172-
/*}*/
173-
/*!* Special handling for open-by-default components in Safari *!*/
174-
/*pid-collapsible[open=true], pid-collapsible[openbydefault=true] {*/
175-
/* height: fit-content !important;*/
176-
/* width: auto !important;*/
177-
/* min-width: 300px !important;*/
178-
/* resize: both !important;*/
179-
/* overflow: auto !important;*/
180-
/*}*/
171+
/* Ensure resize works in Safari */
172+
pid-collapsible.resize-both {
173+
/*position: relative;*/
174+
-webkit-resize: both !important;
175+
/*resize: both !important;*/
176+
/*overflow: auto !important;*/
177+
/*max-width: 100% !important;*/
178+
/*max-height: 90vh !important;*/
179+
/*display: block !important;*/
180+
}
181+
182+
/* Enhanced resize handle visibility for Safari */
183+
pid-collapsible.resize-both::after {
184+
content: '';
185+
position: absolute;
186+
bottom: 0;
187+
right: 0;
188+
width: 15px;
189+
height: 15px;
190+
cursor: nwse-resize;
191+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 2L2 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 8L8 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 14L14 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
192+
background-repeat: no-repeat;
193+
background-position: bottom right;
194+
z-index: 10;
195+
pointer-events: none;
196+
}
197+
198+
181199
}
182200

183201
/*
@@ -235,8 +253,8 @@ pid-collapsible.resize-both::after {
235253
}
236254

237255
pid-collapsible.resize-both::after {
238-
background: currentColor;
239-
opacity: 0.5;
256+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 2L2 22' stroke='currentColor' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M22 8L8 22' stroke='currentColor' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M22 14L14 22' stroke='currentColor' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
257+
opacity: 0.9;
240258
}
241259
}
242260

packages/stencil-library/src/components/pid-component/pid-component.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,22 @@ pid-component {
3232
-webkit-resize: both !important;
3333
resize: both !important;
3434
overflow: auto !important;
35+
position: relative !important;
36+
}
37+
38+
/* Add visible resize handle for Safari */
39+
pid-component pid-collapsible.resize-both::after {
40+
content: '';
41+
position: absolute;
42+
bottom: 0;
43+
right: 0;
44+
width: 15px;
45+
height: 15px;
46+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 2L2 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 8L8 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 14L14 22' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
47+
background-repeat: no-repeat;
48+
background-position: bottom right;
49+
cursor: nwse-resize;
50+
z-index: 10;
51+
pointer-events: none;
3552
}
3653
}

0 commit comments

Comments
 (0)