diff --git a/css/custom_theme.css.php b/css/custom_theme.css.php index c78c3b8003..847f51d7b1 100644 --- a/css/custom_theme.css.php +++ b/css/custom_theme.css.php @@ -734,6 +734,19 @@ gap: 2%; } +.with_frm_style.frm_inline_top .frm_submit.frm_flex, +.with_frm_style .frm_submit.frm_flex.frm_inline_submit { + align-items: flex-start; + align-content: flex-start; + row-gap: 0; +} + +.with_frm_style.frm_inline_top .frm_submit.frm_flex::before, +.with_frm_style .frm_submit.frm_flex.frm_inline_submit::before { + flex-basis: 100%; + order: -2; +} + .with_frm_style .frm_submit.frm_flex button.frm_button_submit ~ .frm_prev_page { order: -1; diff --git a/tests/phpunit/styles/test_FrmStyle.php b/tests/phpunit/styles/test_FrmStyle.php index a462a5401c..bd2bfc2d6e 100644 --- a/tests/phpunit/styles/test_FrmStyle.php +++ b/tests/phpunit/styles/test_FrmStyle.php @@ -287,6 +287,24 @@ public function test_get_all() { $this->assertSame( FrmStylesController::$post_type, reset( $styles )->post_type ); } + /** + * With the default "frm_submit frm_flex" submit HTML, the inline submit label spacer must take a full row + * and the button must not be vertically centered against it. + * + * @see https://github.com/Strategy11/formidable-pro/issues/6894 + */ + public function test_generated_css_aligns_inline_flex_submit_with_inputs() { + $css = $this->run_private_method( + array( new FrmStyle(), 'get_css_content' ), + array( FrmAppHelper::plugin_path() . '/css/custom_theme.css.php' ) + ); + $submit_selector = '.with_frm_style.frm_inline_top .frm_submit.frm_flex,.with_frm_style .frm_submit.frm_flex.frm_inline_submit'; + $spacer_selector = '.with_frm_style.frm_inline_top .frm_submit.frm_flex::before,.with_frm_style .frm_submit.frm_flex.frm_inline_submit::before'; + + $this->assertStringContainsString( $submit_selector . ' {align-items: flex-start;', $css ); + $this->assertStringContainsString( $spacer_selector . ' {flex-basis: 100%;order: -2;}', $css ); + } + /** * The CSS version must be a zero-padded timestamp so distinct save times * never collide (e.g. 1 Jan 10:59 and 11 Jan 00:59 both produced "111059").