Skip to content

Commit aa403a3

Browse files
committed
make phone input look better with animated and outlined styles
1 parent 6c1d00a commit aa403a3

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

projects/packages/forms/src/blocks/contact-form/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@
955955
.jetpack-field__input,
956956
.jetpack-field__textarea,
957957
.jetpack-field-dropdown__toggle {
958-
padding-top: 1.4em;
958+
padding-top: max(var(--jetpack--contact-form--input-padding-top, 0), 1.4em);
959959
padding-left: var(--jetpack--contact-form--animated-left-offset);
960960
}
961961

projects/packages/forms/src/blocks/input-phone/editor.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100
.is-style-animated .jetpack-contact-form .jetpack-field.jetpack-field-phone,
101101
.is-style-animated .jetpack-contact-form .jetpack-field.jetpack-field-telephone {
102102

103+
.jetpack-field__input {
104+
padding-top: max(var(--jetpack--contact-form--input-padding-top, 0), 1.4em);
105+
}
106+
103107
&:not(.has-placeholder):not(.is-selected),
104108
&:not(.has-placeholder):not(.has-child-selected) {
105109

@@ -120,6 +124,13 @@
120124
.is-style-outlined .jetpack-contact-form .jetpack-field.jetpack-field-phone,
121125
.is-style-outlined .jetpack-contact-form .jetpack-field.jetpack-field-telephone {
122126

127+
.jetpack-field__input {
128+
129+
&.is-selected {
130+
box-shadow: unset;
131+
}
132+
}
133+
123134
&:not(.has-placeholder):not(.is-selected),
124135
&:not(.has-placeholder):not(.has-child-selected) {
125136

projects/packages/forms/src/contact-form/css/phone-field.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@
7474
.is-style-animated & {
7575

7676
.jetpack-field__input-phone-wrapper {
77-
padding-top: 1.4em;
77+
padding-top: max(var(--jetpack--contact-form--input-padding-top, 0), 1.4em);
7878
padding-left: var(--jetpack--contact-form--animated-left-offset);
7979
padding-right: var(--jetpack--contact-form--animated-right-offset);
8080

81+
&:has(.jetpack-field__input-element:focus) {
82+
outline: unset;
83+
}
84+
8185
&:not(:has(*:focus, *:active)) {
8286

8387
.jetpack-field__input-prefix:not(:has(~ .has-placeholder),:has(~ .has-value)) {
@@ -103,6 +107,10 @@
103107

104108
.jetpack-field__input-phone-wrapper {
105109

110+
&:has(.jetpack-field__input-element:focus) {
111+
outline: unset;
112+
}
113+
106114
&:not(:has(*:focus, *:active)) {
107115

108116
// notched label is game of superpositions with z-index,

0 commit comments

Comments
 (0)