svelte-datepicker icon indicating copy to clipboard operation
svelte-datepicker copied to clipboard

Unable to apply custom styling

Open mcmxcdev opened this issue 4 years ago • 4 comments

In the source code, there is an option to provide custom styling through the styling prop. Unfortunately, there is no example of how to use it properly.

It always throws ctx[2].toWrapperStyle is not a function and from inspecting the source code, there is no .toWrapperStyle method defined.

mcmxcdev avatar Jan 25 '21 08:01 mcmxcdev

Yeah I haven't quite documented this yet as it was a lift-and-shift of the old styling code which I didn't like.

You need to import and create this from the library:

https://github.com/beyonk-adventures/svelte-datepicker/blob/master/src/calendar-style.js

import { DatePicker, CalendarStyle } ...

and then pass the instance as the styling property.

antony avatar Jan 25 '21 09:01 antony

Is it possible to extend this CalendarStyle to make it more customizable? I want the calendar button to take 100% of the parent div, but this is not possible currently with the current implementation.

diblaze avatar Mar 08 '21 10:03 diblaze

Absolutely, we're completely open to PRs which extend the styling.

antony avatar Mar 08 '21 13:03 antony

Did anyone have a solution to how to style the component? importing CalendarStyle seems to break the page...

chanmathew avatar Dec 24 '22 05:12 chanmathew