diff --git a/landing/src/app/ui/contact-form.scss b/landing/src/app/ui/contact-form.scss index 35072e4..67997d3 100644 --- a/landing/src/app/ui/contact-form.scss +++ b/landing/src/app/ui/contact-form.scss @@ -53,3 +53,31 @@ transform: translateY(-3rem) scale(1) !important; } } + +// Two things the library gets wrong once a field is in a real state. +// +// 1. The label changes shape when you focus it. `@pi/ui` applies the theme's +// label typography under `:not(.mdc-text-field--focused)`, so text-transform, +// letter-spacing and weight all fall away the moment the field takes focus: +// "MENSAJE *" becomes "Mensaje *" in a lighter face, and the label visibly +// reflows under the cursor. Restated here without that guard. Colour is +// deliberately left alone — Material tints the label on focus, and that part +// is wanted. +// +// 2. The focus ring is a stadium on the textarea. Both the notched outline and +// the gradient ring take their radius from `--pi-theme-field-radius`, which +// the `alternative` shell sets to 999px. That is right for a 48px-tall input +// and wrong for a 112px-tall textarea: the two shapes stop coinciding and +// the field is drawn twice, once in the error colour and once in the +// gradient, offset from each other. A fixed radius makes them agree again. +:host ::ng-deep { + .pi-field .mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label { + text-transform: var(--pi-theme-field-label-transform, none); + letter-spacing: var(--pi-theme-field-label-letter-spacing, normal); + font-weight: var(--pi-theme-field-label-weight, inherit); + } + + .pi-field.pi-form-field__textarea { + --pi-theme-field-radius: 1.25rem; + } +}