Skip to content

Add datetime component styling to match datepicker#47

Closed
gaurav5826 wants to merge 1 commit into
adobe:mainfrom
gaurav5826:stylingForDateTimeComponent
Closed

Add datetime component styling to match datepicker#47
gaurav5826 wants to merge 1 commit into
adobe:mainfrom
gaurav5826:stylingForDateTimeComponent

Conversation

@gaurav5826

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.

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 12:42
@gaurav5826 gaurav5826 closed this Jul 7, 2026
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.

1 participant