Repository navigation
Apply error text colour to placeholders in fields with errors #3632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
673bdf5
625d1a6
f71fb06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -412,6 +412,24 @@ | |
| border-style:var(--field-border-style)<?php echo esc_html( $important ); ?>; | ||
| } | ||
|
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field input::placeholder, | ||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field textarea::placeholder, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field input.frm_default, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field textarea.frm_default, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .placeholder, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_form_field input:invalid::placeholder, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_form_field textarea:invalid::placeholder { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| color:var(--text-color-error)<?php echo esc_html( $important ); ?>; | ||
| } | ||
|
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) input::placeholder, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) textarea::placeholder, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) input.frm_default, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) textarea.frm_default, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm_combo_inputs_container > .frm_form_field:not(.frm_blank_field) .placeholder { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| color:var(--text-color-disabled)<?php echo esc_html( $important ); ?>; | ||
| } | ||
|
|
||
| <?php | ||
| // Only include this style when the signatures add-on is active | ||
| if ( class_exists( 'FrmSigField' ) ) : | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -301,4 +301,21 @@ public function test_save_settings_stores_padded_timestamp_version() { | |
| $this->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 ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| $this->assertMatchesRegularExpression( '/\.frm_form_field input:invalid::placeholder,[^{]*\{color:var\(--text-color-error\)/', $css ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // 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 ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.