Skip to content

Commit b2a3bb5

Browse files
authored
[6.x] Nested bard fixed toolbars - remove sticky stacking approach (#13750)
1 parent f6705f5 commit b2a3bb5

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

  • resources/css/components/fieldtypes

resources/css/components/fieldtypes/bard.css

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
}
136136
}
137137

138-
/* When there's a fixed toolbar the the bard editor should have square radius in the top corners to but up against the bottom of the toolbar */
138+
/* When there's a fixed toolbar the bard editor should have square radius in the top corners to but up against the bottom of the toolbar */
139139
.bard-fieldtype:has(> &) {
140140
.bard-editor:focus-within {
141141
border-top-left-radius: 0!important;
@@ -154,7 +154,7 @@
154154
.bard-fixed-toolbar {
155155
z-index: var(--z-index-portal);
156156
position: sticky;
157-
@apply -top-2;
157+
@apply sm:-top-2;
158158
/* Prevent the sticky toolbar from hitting the very end of container, which causes it to overlap the container's border-radius */
159159
margin-block-end: 8px;
160160
/* Pull the subsequent element up to compensate for this. The focus ring adjustment here keeps the focus ring from disappearing into the toolbar, which would make the focus ring appear bottom heavy. */
@@ -164,10 +164,17 @@
164164
}
165165
}
166166

167-
/* Bard field with a fixed toolbar > then another fixed toolbar inside this */
168-
.bard-fieldtype:has(> .bard-fixed-toolbar) .bard-content .bard-fixed-toolbar {
169-
@apply top-8;
167+
/* Where a Bard fieldtype with a fixed toolbar... */
168+
.bard-fieldtype:has(> .bard-fixed-toolbar) {
169+
/* has a nested Bard fieldtype with a fixed toolbar _with focus_ */
170+
&:has(.bard-fieldtype .bard-content:focus) {
171+
/* release the sticky positioning so that it doesn't cover the focused Bard toolbar */
172+
> .bard-fixed-toolbar {
173+
position: unset;
174+
}
175+
}
170176
}
177+
171178
/* Bard > Grid > Bard */
172179
.bard-content .grid-fieldtype .bard-fixed-toolbar {
173180
@apply top-16;
@@ -178,7 +185,7 @@
178185
top: -24px;
179186
}
180187

181-
/* Responive Wangjangling */
188+
/* Responsive Wangjangling */
182189
@media (width >= theme(--breakpoint-md)) {
183190
/* Fixed toolbar below fixed global header */
184191
.bard-fixed-toolbar {

0 commit comments

Comments
 (0)