Skip to content

Commit 3992996

Browse files
bfintalArukuen
andauthored
fix (columns): disallow column order from spilling over to nested column blocks (#3423)
* fix (columns): disallow column order from spilling over to nested column blocks * fix(columns): also target non columns block with column innerblocks * undo revision * prevent columns from being reordered --------- Co-authored-by: [email protected] <> Co-authored-by: Alquen Sarmiento <[email protected]>
1 parent f5738ff commit 3992996

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/block/accordion/style.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
transform: translateY(25px);
100100
opacity: 0;
101101
}
102+
103+
// Prevent inside columns from being re-ordered when a parent column block
104+
// has custom ordering.
105+
> .stk-block-column {
106+
order: initial !important;
107+
}
102108
}
103109

104110
// This is for the column hack. Remove margin for the wrapper div if accordion is inside a columns block

src/block/columns/style.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
margin-right: auto;
1616
}
1717

18+
// Add a 0 specificity style to set the default column order. This is to prevent
19+
// the column order from spilling to nested blocks.
20+
// Target the stk-column-wrapper to also include blocks with column innerblocks
21+
// but are not columns (no stk-block-columns), like accordion and horizontal scroller.
22+
:where(.stk-block-columns) {
23+
@for $i from 1 through 20 {
24+
--stk-col-order-#{ $i }: #{ $i };
25+
}
26+
}
27+
1828
// Column order.
1929
@for $i from 1 through 20 {
2030
.stk-block-column:nth-child(#{ $i }) {

0 commit comments

Comments
 (0)