Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 13.3k
feat(datetime): add parts for calendar day, active, and today#27641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0293b9d6ca4cda8c28d11c697ef964fa7cb16fdd91cd6e0a41a588b0a0f6cd571273b6c0772dbac71cfa9b93291e314040f5c8c82141fc3bd522a76c062227e34124abeec11c7d91ffac2a5c328bc040774547d6de13e1585e250d9cfe9712a63bf5198bd3d6f4d463aa3881ecbba93780af52cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -428,6 +428,9 @@ ion-datetime,css-prop,--background-rgb | ||
| ion-datetime,css-prop,--title-color | ||
| ion-datetime,css-prop,--wheel-fade-background-rgb | ||
| ion-datetime,css-prop,--wheel-highlight-background | ||
| ion-datetime,part,calendar-day | ||
| ion-datetime,part,calendar-day active | ||
brandyscarney marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ion-datetime,part,calendar-day today | ||
| ion-datetime,part,month-year-button | ||
| ion-datetime,part,time-button | ||
| ion-datetime,part,time-button active | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -20,7 +20,7 @@ | ||
| @include padding($datetime-ios-padding, $datetime-ios-padding, $datetime-ios-padding, $datetime-ios-padding); | ||
| border-bottom: $datetime-ios-border-color; | ||
| font-size: 14px; | ||
| } | ||
| @@ -85,27 +85,32 @@ | ||
| */ | ||
| @include padding($datetime-ios-padding * 0.5, $datetime-ios-padding * 0.5, $datetime-ios-padding * 0.5, $datetime-ios-padding * 0.5); | ||
| align-items: center; | ||
| height: calc(100% - #{$datetime-ios-padding}); | ||
| } | ||
| :host .calendar-day { | ||
| font-size: 20px; | ||
| } | ||
| :host .calendar-day-wrapper { | ||
brandyscarney marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @include padding(4px); | ||
| // This is required so that the calendar day wrapper | ||
| // will collapse instead of expanding to fill the button | ||
| height: 0; | ||
| .calendar-day:focus .calendar-day-highlight, | ||
| .calendar-day.calendar-day-active .calendar-day-highlight { | ||
| opacity: 0.2; | ||
| min-height: 16px; | ||
| } | ||
| .calendar-day.calendar-day-active .calendar-day-highlight { | ||
| background: current-color(base); | ||
| :host .calendar-day { | ||
| width: $datetime-ios-day-width; | ||
| min-width: $datetime-ios-day-width; | ||
| height: $datetime-ios-day-height; | ||
| font-size: 20px; | ||
| } | ||
| // !important is needed here to overwrite custom highlight background, which is inline. | ||
| // Does not apply to the active state because highlights aren't applied at all there. | ||
| .calendar-day:focus .calendar-day-highlight { | ||
| /* stylelint-disable-next-line declaration-no-important */ | ||
| background: current-color(base) !important; | ||
| .calendar-day.calendar-day-active { | ||
| background: current-color(base, 0.2); | ||
| } | ||
brandyscarney marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /** | ||
| @@ -135,12 +140,6 @@ | ||
| color: current-color(contrast); | ||
| } | ||
| .calendar-day.calendar-day-today.calendar-day-active .calendar-day-highlight { | ||
| background: current-color(base); | ||
| opacity: 1; | ||
| } | ||
| // Time / Header | ||
| // ----------------------------------- | ||
| :host .datetime-time { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -290,6 +290,10 @@ ion-picker-column-internal { | ||
| } | ||
| :host .calendar-body .calendar-month { | ||
| display: flex; | ||
| flex-flow: column; | ||
| /** | ||
| * Swiping should snap to at | ||
| * most one month at a time. | ||
| @@ -325,13 +329,31 @@ ion-picker-column-internal { | ||
| grid-template-columns: repeat(7, 1fr); | ||
| } | ||
| :host .calendar-day-wrapper { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| // Adding a min width and min height allows | ||
| // it to shrink smaller than its content | ||
| // which keeps the calendar day highlight | ||
| // larger while letting the grid items shrink | ||
| min-width: 0; | ||
| min-height: 0; | ||
brandyscarney marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| overflow: visible; | ||
| } | ||
| /** | ||
| * Center the day text vertically | ||
| * and horizontally within its grid cell. | ||
| */ | ||
| :host .calendar-day { | ||
| @include padding(0px, 0px, 0px, 0px); | ||
| @include margin(0px, 0px, 0px, 0px); | ||
| @include border-radius(50%); | ||
| @include padding(0px); | ||
| @include margin(0px); | ||
| display: flex; | ||
| @@ -362,16 +384,10 @@ ion-picker-column-internal { | ||
| opacity: 0.4; | ||
| } | ||
| .calendar-day-highlight { | ||
| @include border-radius(32px, 32px, 32px, 32px); | ||
| @include padding(4px, 4px, 4px, 4px); | ||
| position: absolute; | ||
| width: 32px; | ||
| height: 32px; | ||
| .calendar-day:focus { | ||
| background: current-color(base, 0.2); | ||
| z-index: -1; | ||
| box-shadow: 0px 0px 0px 4px current-color(base, 0.2); | ||
| } | ||
| // Time / Header | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.