-
Notifications
You must be signed in to change notification settings - Fork 13.3k
feat(datetime, datetime-button, picker-column, picker-column-option): improve styling flexibility by removing default color prop #31261
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
base: major-9.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -190,6 +190,13 @@ | |||||||||||||||||||||||||||||||||||||||
| justify-content: space-between; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // Default text color for action buttons (cancel, clear, done). | ||||||||||||||||||||||||||||||||||||||||
| // When datetime doesn't receive a color prop. | ||||||||||||||||||||||||||||||||||||||||
| :host .datetime-action-buttons ion-button { | ||||||||||||||||||||||||||||||||||||||||
| --color: #{ion-color(primary, base)}; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||
| * The confirm and clear buttons are grouped in a | ||||||||||||||||||||||||||||||||||||||||
| * container so that they appear on the end opposite | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -366,9 +373,15 @@ | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .calendar-day:not(.calendar-day-adjacent-day):focus { | ||||||||||||||||||||||||||||||||||||||||
| background: current-color(base, 0.2); | ||||||||||||||||||||||||||||||||||||||||
| background: ion-color(primary, base, 0.2); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| box-shadow: 0px 0px 0px 4px ion-color(primary, base, 0.2); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| :host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus { | ||||||||||||||||||||||||||||||||||||||||
| background: #{current-color(base, 0.2)}; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| box-shadow: 0px 0px 0px 4px current-color(base, 0.2); | ||||||||||||||||||||||||||||||||||||||||
| box-shadow: 0px 0px 0px 4px #{current-color(base, 0.2)}; | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+376
to
+384
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Nit: you don't need to escape unless it's in a CSS variable |
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // Time / Header | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -415,6 +428,10 @@ | |||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| :host .time-body-active { | ||||||||||||||||||||||||||||||||||||||||
| color: ion-color(primary, base); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| :host(.ion-color) .time-body-active { | ||||||||||||||||||||||||||||||||||||||||
| color: current-color(base); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
@@ -425,7 +442,11 @@ | |||||||||||||||||||||||||||||||||||||||
| // Year Picker | ||||||||||||||||||||||||||||||||||||||||
| // ----------------------------------- | ||||||||||||||||||||||||||||||||||||||||
| :host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle { | ||||||||||||||||||||||||||||||||||||||||
| color: #{current-color(base)}; | ||||||||||||||||||||||||||||||||||||||||
| color: ion-color(primary, base); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| :host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle { | ||||||||||||||||||||||||||||||||||||||||
| color: current-color(base); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .calendar-month-year { | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,7 +181,7 @@ export class Datetime implements ComponentInterface { | |
| * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. | ||
| * For more information on colors, see [theming](/docs/theming/basics). | ||
| */ | ||
| @Prop() color?: Color = 'primary'; | ||
| @Prop() color?: Color; | ||
|
|
||
| /** | ||
| * The name of the control, which is submitted with the form data. | ||
|
|
@@ -1813,6 +1813,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {items.map((item) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The month/year picker was displaying selected values in the datetime's color (for example, red for |
||
| part={item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={item.value} | ||
| disabled={item.disabled} | ||
|
|
@@ -1931,6 +1932,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {days.map((day) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={day.value} | ||
| disabled={day.disabled} | ||
|
|
@@ -1979,6 +1981,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {months.map((month) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={month.value} | ||
| disabled={month.disabled} | ||
|
|
@@ -2026,6 +2029,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {years.map((year) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={year.value} | ||
| disabled={year.disabled} | ||
|
|
@@ -2101,6 +2105,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {hoursData.map((hour) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={hour.value} | ||
| disabled={hour.disabled} | ||
|
|
@@ -2142,6 +2147,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {minutesData.map((minute) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART} | ||
| key={minute.value} | ||
| disabled={minute.disabled} | ||
|
|
@@ -2190,6 +2196,7 @@ export class Datetime implements ComponentInterface { | |
| > | ||
| {dayPeriodData.map((dayPeriod) => ( | ||
| <ion-picker-column-option | ||
| color={this.color} | ||
| part={ | ||
| dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any breaking changes associated with this, like CSS that may start overriding where it previously wasn't?