-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat: Add part to ion-datetime component to allow CSS customization #24963
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
Comments
Thanks for the issue. Could you help me understand which parts of Datetime has several CSS Variables that you can use as well as the |
Look like there are multiple event as per event, You want to apply background. @iwoogy Is purple square selected one ? |
We encourage developers to theme components in a way that matches the overall theme of their application. To this, you can generate a new custom color theme and use the Here is an example: https://codepen.io/liamdebeasi/pen/YzYWBgV The Can you try this and let me know if it works? |
Thanks for your support. It works to fulfill 50% of the designer requirements. The today date and the selected date have to be the same color using the color attribute. Does the styling of the shadow parts could help allowing more control over the styling ? Is it possible to hide the weekdays in order to have many ion-date components on the same page with only one weekdays header ? |
Can you provide your use cases for these additional customizations? We intended for At the moment it is not possible to hide the weekdays on the datetime component. |
I'm in the process of converting a NativeScript into Ionic. I used to implement the graphic designer requirements in NativeScript in a custom calendar. I was wondering if the new component can help reproduce the same requirements.
Ok. Noted. |
Hello @iwoogy. Looks like you closed this issue. Were you able to resolve this issue? If so how did you achieve this? I'm in the same boat and wanted a solution for this use case. Thanks. |
Hello @ckang777 I didn't solve the issue. I negociated with the graphic designer to scale down the customisation ambition to fit the current constraint. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Describe the Feature Request
I would like to customize the CSS styles of the ion-datetime in a more precise way.
I read this article that explain how to access styles inside the shadow dom.
https://ionicframework.com/docs/theming/css-shadow-parts
I noticed that parts are not exposed in the ion-datetime

Describe the Use Case
I would like to implement that kind of styling
Describe Preferred Solution
Adding part attribtues to the shadow root children will help to access the styling of ion-datetime component
Describe Alternatives
No alternative for now.
Related Code
The code is pretty simple
Additional Information
No response
The text was updated successfully, but these errors were encountered: