Skip to content

Commit 324ae26

Browse files
committed
add datetime new variable to control opacity on ionic theme
1 parent 39ce144 commit 324ae26

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

core/src/components/datetime/datetime.common.scss

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,16 @@
2525
width: 100%;
2626
}
2727

28-
:host .calendar-body,
29-
:host .datetime-year {
30-
opacity: 0;
31-
}
32-
3328
:host(:not(.datetime-ready)) .datetime-year {
3429
position: absolute;
3530
pointer-events: none;
3631
}
3732

38-
:host(.datetime-ready) .calendar-body {
39-
opacity: 1;
40-
}
41-
4233
:host(.datetime-ready) .datetime-year {
4334
display: none;
44-
45-
opacity: 1;
4635
}
4736

37+
4838
/**
4939
* Changing the physical order of the
5040
* picker columns in the DOM is added

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212
--background: #{globals.$ion-bg-surface-default};
1313
--focus-ring-color: #{globals.$ion-border-focus-default};
1414
--focus-ring-width: #{globals.$ion-border-radius-025};
15+
--body-opacity: 0;
16+
--year-opacity: 0;
17+
}
18+
19+
:host .calendar-body {
20+
opacity: var(--body-opacity);
21+
}
22+
23+
:host .datetime-year {
24+
opacity: var(--year-opacity);
25+
}
26+
27+
:host(.datetime-ready) .calendar-body {
28+
--body-opacity: 1;
29+
}
30+
31+
:host(.datetime-ready) .datetime-year {
32+
--year-opacity: 1;
1533
}
1634

1735
// Header

core/src/components/datetime/datetime.native.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
max-width: 350px;
2424
}
2525

26+
:host .calendar-body,
27+
:host .datetime-year {
28+
opacity: 0;
29+
}
30+
31+
:host(.datetime-ready) .calendar-body,
32+
:host(.datetime-ready) .datetime-year {
33+
opacity: 1;
34+
}
35+
2636
/**
2737
* This ensures that the picker is appropriately
2838
* sized and never truncates the text.

0 commit comments

Comments
 (0)