Skip to content

Commit 75af694

Browse files
committed
Backport of PR wintercms/winter#1374
1 parent e261d30 commit 75af694

7 files changed

Lines changed: 683 additions & 124 deletions

File tree

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,67 @@
1-
/*
2-
* This is a sample StyleSheet file used by EnhancedRelation
3-
*
4-
* You can delete this file if you want
5-
*/
6-
.field-checkboxlist .checkboxlist-controls > div:nth-child(even) {
1+
div[data-control="relation"] .field-checkboxlist .checkboxlist-controls>div:nth-child(even) {
72
margin-left: auto;
83
margin-right: 0;
94
}
105

11-
.checkboxlist-item {
12-
--background-padding : 10px;
13-
6+
div[data-control="relation"] .checkboxlist-item {
7+
--background-padding: 10px;
148
display: flex;
159
flex-direction: row;
1610
align-items: center;
1711
justify-content: start;
1812
flex-wrap: wrap;
1913
margin-bottom: 10px;
2014
margin-top: 15px;
15+
}
2116

22-
& ~ & {
23-
margin-top: 0;
24-
}
25-
26-
a i {
27-
display: block;
28-
transition: transform 0.25s ease-in-out;
29-
}
30-
31-
&:has(.checkboxlist-item).open {
32-
background: linear-gradient(90deg, rgba(0, 0, 0, 0) calc(var(--background-padding) - 1px), rgba(0, 0, 0, 0.25) var(--background-padding), rgba(0, 0, 0, 0) calc(var(--background-padding) + 1px));
33-
34-
> a i {
35-
transform: rotate(90deg);
36-
}
37-
}
38-
39-
& & {
40-
--background-padding: 20px;
17+
div[data-control="relation"] .checkboxlist-item .checkboxlist-item-toggle .icon-chevron-right {
18+
display: block;
19+
transition: transform 0.15s ease-in-out;
20+
}
4121

42-
margin-left: 10px;
43-
padding-left: 10px;
44-
}
22+
div[data-control="relation"] .checkboxlist-item:has(.checkboxlist-item).open {
23+
background: linear-gradient(90deg, rgba(0, 0, 0, 0) calc(var(--background-padding) - 1px), rgba(0, 0, 0, 0.25) var(--background-padding), rgba(0, 0, 0, 0) calc(var(--background-padding) + 1px));
24+
}
4525

26+
div[data-control="relation"] .checkboxlist-item:has(.checkboxlist-item).open>.checkboxlist-item-toggle .icon-chevron-right {
27+
transform: rotate(90deg);
28+
}
4629

47-
& .custom-checkbox {
48-
flex-grow: 1;
49-
margin-top: 0;
50-
margin-bottom: 0;
51-
}
30+
div[data-control="relation"] .checkboxlist-item .custom-checkbox {
31+
flex-grow: 1;
32+
margin-top: 0;
33+
margin-bottom: 0;
5234
}
5335

54-
.checkboxlist-item-expand-collapse {
36+
div[data-control="relation"] .checkboxlist-item-toggle {
5537
margin: 0 calc(1rem + 15px) 0 1rem;
5638
}
5739

58-
.checkboxlist-children {
40+
div[data-control="relation"] .checkboxlist-item-toggle .icon-chevron-right {
41+
pointer-events: none;
42+
}
43+
44+
div[data-control="relation"] .checkboxlist-children {
5945
width: 100%;
6046
display: grid;
6147
grid-template-rows: 0fr;
62-
transition: grid-template-rows 0.5s ease-in-out;
48+
transition: grid-template-rows 0.2s ease-in-out;
49+
}
50+
51+
div[data-control="relation"] .checkboxlist-children.open {
52+
grid-template-rows: 1fr;
53+
}
54+
55+
div[data-control="relation"] .checkboxlist-children>div {
56+
overflow: hidden;
57+
}
58+
59+
div[data-control="relation"] .checkboxlist-item .checkboxlist-item {
60+
--background-padding: 20px;
61+
margin-left: 10px;
62+
padding-left: 10px;
63+
}
6364

64-
&.open {
65-
grid-template-rows: 1fr;
66-
}
67-
& > div {
68-
overflow: hidden;
69-
}
65+
div[data-control="relation"] .checkboxlist-item~.checkboxlist-item {
66+
margin-top: 0;
7067
}

0 commit comments

Comments
 (0)