Skip to content
Open
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
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/fix-form-checkboxes-colors
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix checkbox checkmark border color to use text color for better contrast
19 changes: 11 additions & 8 deletions projects/packages/forms/src/contact-form/css/grunion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
--jetpack--contact-form--input-padding: 16px;
--jetpack--contact-form--font-size: 16px;
--jetpack--contact-form--error-color: #b32d2e;
// mind that this is not really "inverted", just fixed to white.
--jetpack--contact-form--inverted-text-color: #fff;
}

Expand Down Expand Up @@ -731,7 +732,6 @@ that needs to mimic the input element styles */
background-color: var(--jetpack--contact-form--input-background);
}


/*
For some reason, when keeping the rule below together with the above selector,
on production builds, the attributes are being reordered, causing side-effects
Expand Down Expand Up @@ -1041,12 +1041,6 @@ on production builds, the attributes are being reordered, causing side-effects
border-radius: 50%;
}

.contact-form .is-style-list input.consent:checked,
.contact-form .is-style-list input.checkbox:checked,
.contact-form .grunion-field-wrap:not(.is-style-plain) input.checkbox-multiple:checked {
background-color: currentColor;

}

.contact-form .is-style-list input.consent::before,
.contact-form .is-style-list input.checkbox::before,
Expand All @@ -1063,13 +1057,22 @@ on production builds, the attributes are being reordered, causing side-effects
transition: opacity 0.1s ease-in-out, scale 0.15s ease-in-out;

font-size: inherit;
border: solid var(--jetpack--contact-form--inverted-text-color, var(--jetpack--contact-form--input-background));
// if checkboxes bg are --jetpack--contact-form--input-background,
// then border-color should text color
border-color: var(--jetpack--contact-form--text-color, fieldText);
border-style: solid;
border-width: 0 2px 2px 0;
transform: translate(-50%, -60%) rotate(40deg);
top: 0;
left: 0;
}

.contact-form .is-style-list input.consent:checked::after {
// consent checkboxes are sometimes scaled.
// Keep it centered and with same angle.
transform: rotate(30deg) scale(0.7) translate(-40%, -15%);
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be different from the current one.

translate(-50%, -60%) rotate(40deg); is that intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to be different from the current one.

Which current one?

}

.contact-form .is-style-list input.consent:checked::before,
.contact-form .is-style-list input.checkbox:checked::before,
.contact-form .grunion-field-wrap:not(.is-style-plain) input.checkbox-multiple:checked::before {
Expand Down
Loading