Skip to content

Commit 6aa47d3

Browse files
authored
feat(datetime): add ionic theme styles to title (#29828)
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 current behavior? <!-- Please describe the current behavior that you are modifying. --> There are no dedicated title styles for the `ionic` theme ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Adds `ionic` theme styles for the datetime default title ## 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. --> [Preview (inline-custom)](https://ionic-framework-c0db80uay-ionic1.vercel.app/src/components/datetime/test/basic?ionic:theme=ionic)
1 parent 78e7eda commit 6aa47d3

11 files changed

+48
-0
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,41 @@
1414
--focus-ring-width: #{globals.$ionic-border-radius-050};
1515
}
1616

17+
// Header
18+
// -----------------------------------
19+
:host .datetime-header {
20+
@include globals.padding(
21+
globals.$ionic-space-200,
22+
globals.$ionic-space-400,
23+
globals.$ionic-space-400,
24+
globals.$ionic-space-400
25+
);
26+
27+
display: flex;
28+
29+
flex-direction: column;
30+
align-items: start;
31+
justify-content: space-between;
32+
33+
height: globals.$ionic-scale-1400;
34+
35+
margin-bottom: globals.$ionic-space-200;
36+
37+
border-bottom: globals.$ionic-border-style-solid globals.$ionic-border-size-025 globals.$ionic-color-neutral-300;
38+
}
39+
40+
:host .datetime-header .datetime-title {
41+
@include globals.typography(globals.$ionic-heading-h6-medium);
42+
43+
color: globals.$ionic-color-neutral-800;
44+
}
45+
46+
:host .datetime-header .datetime-selected-date {
47+
@include globals.typography(globals.$ionic-body-md-regular);
48+
49+
color: globals.$ionic-color-neutral-1000;
50+
}
51+
1752
// Calendar Header
1853
// -----------------------------------
1954

core/src/components/datetime/test/basic/datetime.e2e.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
2929

3030
await expect(datetime).toHaveScreenshot(screenshot(`datetime-basic`));
3131
});
32+
33+
test('should render default title', async ({ page }) => {
34+
await page.setContent(
35+
`
36+
<ion-datetime show-default-title="true" value="2022-06-06T16:30"></ion-datetime>
37+
`,
38+
config
39+
);
40+
41+
const datetime = page.locator('ion-datetime');
42+
43+
await expect(datetime).toHaveScreenshot(screenshot(`datetime-basic-default-title`));
44+
});
3245
});
3346
});
3447

Loading
Loading
Loading
19 KB
Loading
27.2 KB
Loading
19.2 KB
Loading
17.2 KB
Loading
23.7 KB
Loading

0 commit comments

Comments
 (0)