From f8904ef12613dd5ed5a2a56db5ad727e44a93ddd Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 11 Apr 2023 11:58:12 -0600 Subject: [PATCH] Fix et2-vbox center alignment --- api/js/etemplate/Layout/Et2Box/Et2Box.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/api/js/etemplate/Layout/Et2Box/Et2Box.ts b/api/js/etemplate/Layout/Et2Box/Et2Box.ts index 3f9ca67160..48e1e8043d 100644 --- a/api/js/etemplate/Layout/Et2Box/Et2Box.ts +++ b/api/js/etemplate/Layout/Et2Box/Et2Box.ts @@ -150,14 +150,21 @@ export class Et2VBox extends Et2Box return [ ...super.styles, css` - :host > div { - flex-direction: column; - } - /* CSS for child elements */ - ::slotted(*) { - /* Stop children from growing vertically. In general we want them to stay their "normal" height */ - flex-grow: 0; - } + :host > div { + flex-direction: column; + } + + :host([align="center"]) > div { + align-items: center; + } + + /* CSS for child elements */ + + ::slotted(*) { + /* Stop children from growing vertically. In general we want them to stay their "normal" height */ + flex-grow: 0; + } + ` ]; }