Skip to content

Commit 5458e06

Browse files
JoaoFerreira-FrontEndIonitronthetaPC
authored
feat(datetime): add styles for adjacent days for ionic theme (#30492)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the new behavior? <!-- Please describe the current behavior that you are modifying. --> Now the adjacent days have proper styles for all their states. And the next-prev month buttons have the right height. ## Changes: <!-- Please describe the behavior or changes that are being added by this PR. --> - add styles for the adjacent days; - add styles for active adjacent day; - add styles for pressed adjacent day; - add styles for focused adjacent day; ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> [ionic preview](https://ionic-framework-git-rou-11702-ionic1.vercel.app/src/components/datetime/test/show-adjacent-days?ionic:theme=ionic) --------- Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
1 parent 708364d commit 5458e06

File tree

23 files changed

+17
-5
lines changed

23 files changed

+17
-5
lines changed

core/src/components/datetime/datetime.ionic.scss

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
--background-activated: #{globals.$ion-primitives-neutral-200};
105105
--background-hover: #{globals.$ion-primitives-neutral-200};
106106
--background-hover-opacity: 1;
107+
min-height: globals.$ion-scale-1000;
107108
}
108109

109110
// TODO(ROU-11119): Rewrite this when we replace the ion-button with a native button
@@ -153,7 +154,8 @@
153154
}
154155

155156
// Selected Day
156-
.calendar-day.calendar-day-active {
157+
.calendar-day.calendar-day-active,
158+
.calendar-day.calendar-day-active.calendar-day-adjacent-day {
157159
background: globals.$ion-semantics-primary-100;
158160
}
159161

@@ -170,8 +172,19 @@
170172
}
171173

172174
// Pressed Day
173-
.calendar-day:active {
174-
background: globals.$ion-semantics-primary-300;
175+
.calendar-day:active,
176+
.calendar-day.calendar-day-adjacent-day:active {
177+
background: globals.$ion-bg-primary-subtle-press;
178+
}
179+
180+
// Adjacent Day
181+
.calendar-day.calendar-day-adjacent-day {
182+
color: globals.$ion-text-subtlest;
183+
}
184+
185+
// Selected Adjacent Day
186+
.calendar-day.calendar-day-active.calendar-day-adjacent-day {
187+
color: globals.$ion-text-default;
175188
}
176189

177190
// Time / Header
@@ -203,7 +216,6 @@
203216

204217
// Calendar / Footer / Action Buttons
205218
// -----------------------------------
206-
207219
:host .datetime-buttons ion-buttons,
208220
.datetime-action-buttons .datetime-action-buttons-container {
209221
flex-flow: column;

core/src/components/datetime/test/show-adjacent-days/datetime.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { configs, test } from '@utils/test/playwright';
44
/**
55
* This behavior does not vary across directions
66
*/
7-
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
7+
configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
88
test.describe(title('datetime: show adjacent days'), () => {
99
test('should not have visual regressions', async ({ page }) => {
1010
await page.goto('/src/components/datetime/test/show-adjacent-days', config);

0 commit comments

Comments
 (0)