WickyNilliams / cally

Small, feature-rich calendar components
https://wicky.nillia.ms/cally/
MIT License
1.06k stars 12 forks source link

Enhancement Request: More Customization Control for Calendar Buttons #34

Closed Cata1989 closed 2 months ago

Cata1989 commented 2 months ago

Summary: Currently, customization options for calendar buttons, especially disabled buttons, are limited. It would be beneficial to provide users with more control over button customization, particularly for disabled buttons. One suggested improvement is to move the hard-coded button hover style into a CSS variable within the host { ... } section. This would allow for easier customization from external sources.

Proposed Enhancement:

Move the hard-coded button hover style, such as button:hover:where(:not(:disabled)) { background: #0000000d; }, into a CSS variable. Define this CSS variable within the host { ... } section, like --button-hover-disabled: #0000000d;. By doing so, users can easily override this style by customizing the value of --button-hover-disabled externally, providing more flexibility and control.

Expected Benefits:

Enhanced customization options for calendar buttons, especially disabled buttons. Improved maintainability and ease of customization by moving hard-coded styles into CSS variables. Facilitated integration with external styling systems, allowing for seamless customization according to user preferences.

Request: Consider implementing this enhancement to provide users with more control and flexibility in customizing calendar buttons, ultimately enhancing the overall user experience.

WickyNilliams commented 2 months ago

Hey this was a bug actually! I just published v0.5.3 with a fix.

Rather than custom properties, i would recommend using the available CSS Parts. They offer much more fine-grained control vs custom properties, since you can set any property you like, plus combine with pseudo-classes.

However there was a bug whereby the disallowed part was not added to the buttons, so you couldn't style them. With the latest changes you can easily customise like:

calendar-month::part(day):hover {
  /* hover regular days */
}

calendar-month::part(disallowed):hover {
  /* hover disallowed days */
}

see an example here: https://codepen.io/WickyNilliams/pen/rNbPEjw

WickyNilliams commented 2 months ago

Just to add: practically every element has a part, along with conditional parts for specific stated (selected, today, disallowed, outside the month etc). Between them and pseudo-classes, every default style should be overridable I believe. If you find some that aren't, let me know and i'll get it fixed

WickyNilliams commented 1 month ago

Just published v0.6.0 which removes hover styles from disabled and disallowed days, based on your feedback. This is a more sensible default I feel. Thanks!

Cata1989 commented 1 month ago

Hello Wicky,

Nice, thank you for your updates. Keep up the good work!

Best regards, Catalin

From: Nick Williams @.> Date: Friday, 10 May 2024 at 17:37 To: WickyNilliams/cally @.> Cc: Catalin Nicolae Lungan @.>, Author @.> Subject: Re: [WickyNilliams/cally] Enhancement Request: More Customization Control for Calendar Buttons (Issue #34) CAUTION - EXTERNAL EMAIL

Just published v0.6.0 which removes hover styles from disabled and disallowed days, based on your feedback. This is a more sensible default I feel. Thanks!

— Reply to this email directly, view it on GitHubhttps://github.com/WickyNilliams/cally/issues/34#issuecomment-2104726224, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXP4HSMVKABGK5QGJ2SNUODZBTLTRAVCNFSM6AAAAABGYTRLA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUG4ZDMMRSGQ. You are receiving this because you authored the thread.Message ID: @.***>

The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Any opinions expressed are mine and do not necessarily represent the opinions of the Company. Emails are susceptible to interference. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is strictly prohibited and may be unlawful. If you have received this message in error, do not open any attachments but please notify the Endava Service Desk on (+44 (0)870 423 0187), and delete this message from your system. The sender accepts no responsibility for information, errors or omissions in this email, or for its use or misuse, or for any act committed or omitted in connection with this communication. If in doubt, please verify the authenticity of the contents with the sender. Please rely on your own virus checkers as no responsibility is taken by the sender for any damage rising out of any bug or virus infection.

Endava plc is a company registered in England under company number 5722669 whose registered office is at 125 Old Broad Street, London, EC2N 1AR, United Kingdom. Endava plc is the Endava group holding company and does not provide any services to clients. Each of Endava plc and its subsidiaries is a separate legal entity and has no liability for another such entity's acts or omissions.