Skip to content

Commit df2f878

Browse files
committed
fix style guide preview
- button group - video popup
1 parent 765dadc commit df2f878

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/components/style-guide/editor.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,15 @@ $guide-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Ro
298298
width: calc(100% / 3 - 16px);
299299
}
300300

301-
> div > :is(.stk-block-horizontal-scroller, .stk-block-icon-box, .stk-block-icon-label, .stk-block-icon-list, .stk-block-map, .stk-block-number-box, .stk-block-price, .stk-block-pricing-box, .stk-block-progress-circle, .stk-block-table-of-contents) {
301+
> div:has(.stk-block-video-popup) {
302+
width: calc(100% / 2 - 12px);
303+
}
304+
305+
> div:has(.stk-block-button-group) {
306+
width: 100%;
307+
}
308+
309+
> div > :is(.stk-block-horizontal-scroller, .stk-block-icon-box, .stk-block-icon-label, .stk-block-icon-list, .stk-block-map, .stk-block-number-box, .stk-block-price, .stk-block-pricing-box, .stk-block-progress-circle, .stk-block-table-of-contents, .stk-block-button-group, .stk-block-video-popup) {
302310
width: 100%;
303311
}
304312

src/util/block-templates.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export const LONG_TEXT = [
1919
__( 'Change arrived slowly, then all at once. Some said goodbye, some stayed longer, and some simply evolved.', i18n ),
2020
]
2121

22+
const BUTTON_GROUP_TEMPLATE = [
23+
[ 'stackable/button', { text: __( 'Button', i18n ) } ],
24+
[ 'stackable/button', { text: __( 'Button', i18n ) } ],
25+
]
26+
2227
const CAROUSEL_TEMPLATE = [
2328
[ 'stackable/column', {}, [
2429
[ 'stackable/heading', { text: __( 'Slide', i18n ) } ],
@@ -148,7 +153,17 @@ const TIMELINE_TEMPLATE = [
148153
] ],
149154
]
150155

156+
const playIcon = '<svg data-prefix="fas" data-icon="play" class="svg-inline--fa fa-play fa-w-14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>'
157+
158+
const VIDEO_POPUP_TEMPLATE = [
159+
[ 'stackable/icon', {
160+
contentAlign: 'center', icon: playIcon, linkHasLink: false,
161+
} ],
162+
[ 'stackable/image', { enableHandles: false } ],
163+
]
164+
151165
export const PLACEHOLDER_INNER_BLOCKS = {
166+
'stackable/button-group': BUTTON_GROUP_TEMPLATE,
152167
'stackable/carousel': CAROUSEL_TEMPLATE,
153168
'stackable/column': COLUMN_TEMPLATE,
154169
'stackable/columns': COLUMNS_TEMPLATE,
@@ -160,4 +175,5 @@ export const PLACEHOLDER_INNER_BLOCKS = {
160175
'stackable/pricing-box': PRICING_BOX_TEMPLATE,
161176
'stackable/tabs': TABS_TEMPLATE,
162177
'stackable/timeline': TIMELINE_TEMPLATE,
178+
'stackable/video-popup': VIDEO_POPUP_TEMPLATE,
163179
}

0 commit comments

Comments
 (0)