Skip to content
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

MARTOR_ENABLE_ADMIN_CSS not disabling bootstrap styling #259

Open
JElgar opened this issue Aug 20, 2024 Discussed in #258 · 2 comments
Open

MARTOR_ENABLE_ADMIN_CSS not disabling bootstrap styling #259

JElgar opened this issue Aug 20, 2024 Discussed in #258 · 2 comments

Comments

@JElgar
Copy link

JElgar commented Aug 20, 2024

Discussed in #258

Originally posted by JElgar August 19, 2024
Hey! I'm trying to find a markdown editor to use in the django admin. This one looks awesome and exactly what I need. The one small thing I'm struggling with is integrating it with unfold.

If I disable unfold and use the vanilla django admin everything works great but if I open an admin form with any martor field with unfold then all the css goes a bit wild.

image

I saw in your README you have

# Disable admin style when using custom admin interface e.g django-grappelli (default is True)
MARTOR_ENABLE_ADMIN_CSS = True

which seems to allude to you supporting this kind of use case but I tried setting it to False but I got the same issue.

I have noticed that folks are having issues with unfold and other markdown editors (e.g. unfoldadmin/django-unfold#497) so potentially not something can be solved here.

@JElgar JElgar changed the title Integration with unfold MARTOR_ENABLE_ADMIN_CSS not disabling bootstrap styling Aug 20, 2024
@JElgar
Copy link
Author

JElgar commented Aug 20, 2024

The styles causing the issues are coming from bootstrap.min.css. It looks like all those styles are pulled in regardless of the value MARTOR_ENABLE_ADMIN_CSS. I wonder if there is a way we can only apply those styling just to the component rather than the whole admin panel?

@agusmakmun
Copy link
Owner

hello @JElgar for this case you can use your own style:

# If you need to use your own themed "bootstrap" or "semantic ui" dependency
# replace the values with the file in your static files dir
MARTOR_ALTERNATIVE_JS_FILE_THEME = "semantic-themed/semantic.min.js"   # default None
MARTOR_ALTERNATIVE_CSS_FILE_THEME = "semantic-themed/semantic.min.css" # default None
MARTOR_ALTERNATIVE_JQUERY_JS_FILE = "jquery/dist/jquery.min.js"        # default None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants