diff --git a/css/_single_theme.css.php b/css/_single_theme.css.php index 4aa58e84fd..3214d1b043 100644 --- a/css/_single_theme.css.php +++ b/css/_single_theme.css.php @@ -412,6 +412,24 @@ border-style:var(--field-border-style); } +. .frm_blank_field input::placeholder, +. .frm_blank_field textarea::placeholder, +. .frm_blank_field input.frm_default, +. .frm_blank_field textarea.frm_default, +. .frm_blank_field .placeholder, +. .frm_form_field input:invalid::placeholder, +. .frm_form_field textarea:invalid::placeholder { + color:var(--text-color-error); +} + +. .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) input::placeholder, +. .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) textarea::placeholder, +. .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) input.frm_default, +. .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) textarea.frm_default, +. .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) .placeholder { + color:var(--text-color-disabled); +} + assertGreaterThanOrEqual( (int) $before, (int) $version ); $this->assertLessThanOrEqual( (int) $after, (int) $version ); } + + /** + * Placeholders in a field with an error must use the Error > Field Text color, not the Read Only text color. + * + * @see https://github.com/Strategy11/formidable-pro/issues/6929 + */ + public function test_generated_css_uses_error_color_for_placeholders_in_fields_with_errors() { + $css = $this->run_private_method( + array( new FrmStyle(), 'get_css_content' ), + array( FrmAppHelper::plugin_path() . '/css/custom_theme.css.php' ) + ); + + $this->assertMatchesRegularExpression( '/\.frm_blank_field input::placeholder,[^{]*\{color:var\(--text-color-error\)/', $css ); + $this->assertMatchesRegularExpression( '/\.frm_form_field input:invalid::placeholder,[^{]*\{color:var\(--text-color-error\)/', $css ); + // Sub fields of a combo field without an error keep the normal placeholder color. + $this->assertMatchesRegularExpression( '/\.frm_form_field:not\(\.frm_blank_field\) input::placeholder,[^{]*\{color:var\(--text-color-disabled\)/', $css ); + } }