Skip to content
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

Fix/form block submit button styles when errors #40762

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Form block: Fix submit button styles when there are errors
13 changes: 6 additions & 7 deletions projects/packages/forms/src/contact-form/css/grunion.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@
.contact-form .contact-form__select-wrapper::after {
position: absolute;
inset-inline-end: calc(var(--jetpack--contact-form--input-padding-left) + 4px);
top: calc(var(--jetpack--contact-form--input-padding-top) + var(--jetpack--contact-form--line-height) / 2);
top: calc(var(--jetpack--contact-form--input-padding-top) + var(--jetpack--contact-form--line-height) / 2);

content: "";
display: block;
width: 8px;
height: 8px;

border-bottom: 2px solid;
border-right: 2px solid;

transform: translateY(-50%) rotate(45deg);
transform-origin: center center;

Expand Down Expand Up @@ -594,7 +594,7 @@ on production builds, the attributes are being reordered, causing side-effects

.contact-form .grunion-field-wrap input.checkbox-multiple:checked::before {
content: "\2713";

position: absolute;
top: calc(var(--jetpack--contact-form--font-size) / 2);
left: calc(var(--jetpack--contact-form--font-size) / 2);
Expand All @@ -603,7 +603,7 @@ on production builds, the attributes are being reordered, causing side-effects

font-size: var(--jetpack--contact-form--font-size);
line-height: 1;

transform: translate(-50%, -50%);
}

Expand Down Expand Up @@ -714,7 +714,6 @@ on production builds, the attributes are being reordered, causing side-effects
}

.contact-form__error {
margin-bottom: var(--wp--style--block-gap, 1.5rem);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main css change. The others were from css formatter.

padding: 1em;
gap: var(--warning-icon-margin);

Expand Down Expand Up @@ -815,4 +814,4 @@ on production builds, the attributes are being reordered, causing side-effects
position: absolute;
white-space: nowrap;
width: 1px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ const setFormError = ( form, invalidFields, opts = {} ) => {
const submitBtn = getFormSubmitBtn( form );

if ( submitBtn ) {
submitBtn.parentNode.insertBefore( error, submitBtn );
submitBtn.parentNode.parentNode.insertBefore( error, submitBtn.parentNode );
} else {
form.appendChild( error );
}
Expand Down
Loading