I want to make the ion-datetime to have the same style as the input style to make my design consistent.
To be clear, please have a look at the image below.
I’ve tried to modify the CSS properties the same way I created the input style but I can’t get the text to be vertically centered. Applying vertical-align: middle or display: flex with align-items: center doesn’t work. Is there any way to achieve this behavior?
Here is my current CSS for both the input and the datetime:
Hi @aaronksaunders ! thanks for answering, that is exactly what I did for the HTML part, but it is not the problem, what I want is to make the text inside the IonDatetime vertically centered.
Just found the answer, after reading the docs carefully and analyzing the structure of the DOM from the devtools, I realize that the text was encapsulated inside the shadow-dom.
In order to make it work, I must first expose the part using ::part, so instead of doing it like this which is doesn’t work:
not understanding what you are looking for… I don’t think you need to that deep in the shadow dom, you are making this more complicated than it needs to be?
take a look at the screen shot for my solution