Skip to content

Add datetime component styling#48

Merged
gaurav5826 merged 1 commit into
mainfrom
stylingForDateTimeComponent
Jul 8, 2026
Merged

Add datetime component styling#48
gaurav5826 merged 1 commit into
mainfrom
stylingForDateTimeComponent

Conversation

@gaurav5826

@gaurav5826 gaurav5826 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Overview

@aemforms/af-react-vanilla-components added a new DateTimeInput component in v1.0.32, updated the styling for the same. Confirmed by rebuilding the theme from source (both current main and the latest published 1.0.19 tag) and finding zero CSS rules for any cmp-adaptiveform-datetime* class. Without these changes, a datetime field renders as a bare, unstyled native browser input instead of matching the boxed/bordered look every other field type gets (date, text, number, email, etc.).

Changes Made

  • src/components/datetime/_datetime.scss (new) — adds .cmp-adaptiveform-datetime { @include input; &__widget { width: 100%; } }, following the same one-line pattern used by sibling components (datepicker, emailinput, telephoneinput). The extra &__widget { width: 100%; } compensates for DateTimeInput wrapping its <input> in an extra <div class="cmp-adaptiveform-datetime__input-wrapper">, unlike DateInput which passes the <input> directly — so it doesn't get flexbox's free align-items: stretch width the way other single-input fields do.
  • src/theme.scss — added the import for the new component, placed alphabetically right after the datepicker import.
  • src/site/_mixins.scss — added div[data-cmp-is="adaptiveFormDatetime"] to the shared margin: 16px 0 selector list. This list is the only source of vertical spacing between fields, and DateTimeInput's outer div carries that attribute, which wasn't in the list — so without this, Date/Time fields would render with zero spacing around them.

JIRA

https://jira.corp.adobe.com/browse/FORMS-26391

Testing

Rebuilt the theme from source and rendered the actual DateInput / DateTimeInput component markup with the built CSS in a headless browser. Confirmed Date and Date/Time fields now render identically in box styling, width, and spacing.

@gaurav5826
gaurav5826 requested a review from amit-mnnit July 7, 2026 18:46
@gaurav5826
gaurav5826 merged commit 80a3943 into main Jul 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants