-
Notifications
You must be signed in to change notification settings - Fork 34
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
Modal elements class conflict with DaisyUI library #71
Comments
Hi @ktecho , Wondering why are you having a conflict. Could you share more details or a working example (github repo)? Thanks. |
@umaranis the style is affecting the outer components somehow. I'm importing it like this:
But that would be another problem. The one I was reporting is DaisyUI styles (defined for the whole project) affecting the modals in this library, because the |
@umaranis if you have access to the Svelte discord: https://discord.com/channels/457912077277855764/1023340103071965194/threads/1199685510394814554 If not, what they told me is that |
Hi @ktecho , I believe what's happening is the style leaking in because you have some global css from DaisyUI.
|
It is not wrong, depends on what we are trying to do. In a library, if the styles are scoped within the components, it would not be possible for library users to change any styles. Global stylesheet is provided so that the library users can modify styles and scoped it the way they want. |
I solved that problem using Solution #1 from here: https://erdemgonul.medium.com/styling-custom-components-in-svelte-3723ad752cd2 But remember the other problem: components having so standard names that other CSS libraries style them. So in this case it would be better to fix it here in this library, that add prefixes to apps that already use CSS libs, right? |
I mean, it's easy renaming I can do a PR, if you want. |
Yes, please submit a PR |
I probably will, but for now I'm using this https://github.com/bowlineai/svelte-lexical by @stayradiated, (sadly archived last week) until this repository supports Svelte 4, SvelteKit 2. |
Hi @ktecho , |
Ahh, I guess that's why he archived it... Do you think this could be useful to take it from there to here? I started using it, but if it's not useful, I can just copy it to my code. |
Oh, I'm getting this, so I think I must wait until migration to SvelteKit 2 is completed: |
HI @ktecho , Upgrade to sveltekit2 is blocked because of this issue with lexical facebook/lexical#1707. You can find more details from the perspective of svelte-lexical here #68 There is still a workaround to upgrade to sveltekit2 but it uses the older CJS module system which disables tree-shaking and increases the download size of the library. Using this technique, I have completed the sveltekit2 upgrade in this branch upgrade-to-sveltekit2. But I am not merging it into the master yet because of the impact on the download size. I would appreciate if you could upvote the blocking issue at facebook/lexical#1707 |
When trying to use the library and the demos, I found that in
InsertImageDialog
, the class "modal" of the modal was being taken by DaisyUI's "modal" class (see https://daisyui.com/components/modal/). That file was in the demo directory, so when I copied that to my code, I removed the "modal" class that was not being used, and it worked.But then it seems that
InsertImageUriDialogBody.svelte
andInsertImageUriDialogBody.svelte
inpackages/svelte-lexical/src/components/toolbar/dialogs
are also using this "modal" class. Those files are not in a demo, but in the library itself, so I would need to fork it to change it.Would you rename the class from those modals, since it's not being used in the .css files, but only in the section that is as follows?
Maybe it could be renamed, so it has a more specific name, the same as you did with
Modal__title
,Modal__content
orButton__root
.The text was updated successfully, but these errors were encountered: