vanilla-calendar-pro icon indicating copy to clipboard operation
vanilla-calendar-pro copied to clipboard

Suggestion. Improvements for the custom class names.

Open o2sevruk opened this issue 10 months ago • 6 comments

I noticed a problem with custom classes. E.g. the plugin provides the ability to change classes using the CSSClasses parameter. But you can't add multiple classes. No, in some cases you can, but after that you will have problems. For example. I can change the dayBtn class like this:

CSSClasses: {
  dayBtn: 'class-1 class-2 class-3'
}

at first glance it works well, but when you select the date you will catch the error because the code is like this:

const arrowEl: HTMLElement | null = element.closest(`.${self.CSSClasses.arrow}`);

Instead of using classes, I suggest you use another attribute, e.g. data-arrow for functionality and keep the classes just for styling.

o2sevruk avatar Apr 12 '24 16:04 o2sevruk

That’s right, you can change one class to another, but not to several. It’s not provided for and shouldn’t work that way.

uvarov-frontend avatar Apr 12 '24 17:04 uvarov-frontend

Hey @uvarov-frontend - thanks for the reply!

At Preline we wanted to integrate your awesome datepicker plugin under third party libraries and would like to know if you have any roadmap to support TailwindCSS in future.

Cheers! Jaha

jahaganiev avatar Apr 21 '24 05:04 jahaganiev

@jahaganiev Good afternoon. I'll add this to my roadmap.

uvarov-frontend avatar Apr 21 '24 07:04 uvarov-frontend

Good Day @uvarov-frontend,

Our team created PR here regarding the above suggestion. Please have a look when you have time and let us know if you need any help with that.

Cheers! Jaha

jahaganiev avatar May 17 '24 22:05 jahaganiev

Good Day @uvarov-frontend,

Our team created PR here regarding the above suggestion. Please have a look when you have time and let us know if you need any help with that.

Cheers! Jaha

Good afternoon, I see you have added partial support for multiple CSS classes, for which you are very grateful, but I plan to completely move away from CSS classes in my code, and transfer all dependencies to data attributes, I will add commits to your PR.

uvarov-frontend avatar Jul 28 '24 09:07 uvarov-frontend

Good Day @uvarov-frontend, Our team created PR here regarding the above suggestion. Please have a look when you have time and let us know if you need any help with that. Cheers! Jaha

Good afternoon, I see you have added partial support for multiple CSS classes, for which you are very grateful, but I plan to completely move away from CSS classes in my code, and transfer all dependencies to data attributes, I will add commits to your PR.

Good Day @uvarov-frontend! Awesome, we look forward forward for that and please feel free to let us know if you need any help. Thanks!

jahaganiev avatar Jul 30 '24 16:07 jahaganiev