Skip to content

Commit

Permalink
fix: adjust styles
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenn00dle committed Dec 13, 2024
1 parent 86c4f3a commit 4ec9675
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/other-scripts/recaptcha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ function addErrorMessage( form, message ) {
const errorText = document.createElement( 'p' );
errorText.textContent = message;
const container = document.createElement( 'div' );
container.classList.add(
'newspack-ui__notice',
'newspack-ui__notice--error',
'newspack-recaptcha-error'
);
container.classList.add( 'newspack-recaptcha-error' );
container.appendChild( errorText );
form.insertBefore( container, form.firstChild );
// Newsletters block errors render below the form.
if ( form.parentElement.classList.contains( 'newspack-newsletters-subscribe' ) ) {
form.append( container );
} else {
container.classList.add( 'newspack-ui__notice', 'newspack-ui__notice--error' );
form.insertBefore( container, form.firstChild );
}
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/other-scripts/recaptcha/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@
}

.newspack-recaptcha-error {
margin-top: 0 !important;
&.newspack-ui__notice--error {
margin-top: 0 !important;
}
}

0 comments on commit 4ec9675

Please sign in to comment.