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

Semantic conflicts with bootstrap #11

Closed
olymk2 opened this issue Nov 2, 2017 · 16 comments · Fixed by #136
Closed

Semantic conflicts with bootstrap #11

olymk2 opened this issue Nov 2, 2017 · 16 comments · Fixed by #136

Comments

@olymk2
Copy link
Contributor

olymk2 commented Nov 2, 2017

This uses semantic.js if you install on a site with bootstrap it breaks dialog boxes becuase they have the same .dialog js methods and similar styles.

Is there a way to fix this with out changing an entire site to use bootstraps no conflict mode ?

currently i have had to remove semantic.js to make dialogs work on my site any better solution ?

I am currently trying to integrate this into django wiki i have a PR with my current progress if interested.

django-wiki/django-wiki#709

@agusmakmun
Copy link
Owner

agusmakmun commented Nov 2, 2017

That why I only including to integrate with Semantic-UI on the features, because to much changes if want to integrate it with bootstrap without conflicts. Let me see your PR, I really appreciate it.

@olymk2
Copy link
Contributor Author

olymk2 commented Nov 3, 2017

Well I kinda opened this for discussion, my fix was to remove semantic.js is it actually used by drac editor ?

Seems semantic is not such a great choice if you want to integrate in other projects Semantic-Org/Semantic-UI#1701 I have yet to see any other django projects use semantic so its makes using the editor limited.

Not sure on the correct approach to even fixing this ? remove semantic and have custom styles prefix semantic css and js files to avoid the conflict perhaps.

or have a toggle to disable it and use bootstrap as an alternative perhaps ?

@olymk2
Copy link
Contributor Author

olymk2 commented Nov 6, 2017

possibly found a solution to this, if we change martor to use sass we can import the classes with a prefix which should solve the problem ?

.martor {
  @import (less) url("semantic.css");
}

for example any thoughts ? not sure how many changes would be required for this.

@agusmakmun
Copy link
Owner

agusmakmun commented Nov 7, 2017

I think not only it, because the html elements between bootstrap and semantic is different. and also about toggle...

@agusmakmun
Copy link
Owner

@olymk2, I suggest to create a new branch if you want to PR..

@olymk2
Copy link
Contributor Author

olymk2 commented Nov 8, 2017

I will i am doing some experiments to try and resolve it, if i get any where i will put in a PR Think i can isolate the css but the javascript auto applies and i have not found a way to isolate it otherr than modify the semantic.js file which may be whats needed.

@agusmakmun
Copy link
Owner

great idea 👍, maybe you also need to looks at the html selectors on martor.js by changing martor.min.js to martor.js

@eriktelepovsky
Copy link

Hi, @olymk2 Have you figured out how to add Bootstrap support without semantic conflicts, please?

@eriktelepovsky
Copy link

eriktelepovsky commented Mar 19, 2018

Maybe using jquery.scoped.js in your own bootstrap project can be a workaround?

Something like tihs:

<script src="{% static '/assets/libraries/jQuery-Scoped-CSS-plugin/jquery.scoped.js' %}"></script>
<script>
    var semantic_link = $('link[href$="semantic.min.css"]');
    semantic_link.remove();
    $('.section-martor').prepend('<style type="text/css" scoped="true"> @import url('+ semantic_link.attr('href') +'); </style>');
    $.scoped();
</script>

@olymk2
Copy link
Contributor Author

olymk2 commented Mar 19, 2018

well you can fix the styles with sass, the above would do a similar job it the javascript that still needs a work around

@reyesvicente
Copy link

What's the fix for this issue?

@r1bnc
Copy link

r1bnc commented Apr 11, 2020

Any update on this issue?

@GitRon
Copy link

GitRon commented Jun 12, 2020

Same issue here. Global fonts and headlines are changend on the page where martor is living.

@agusmakmun agusmakmun linked a pull request Sep 15, 2020 that will close this issue
@GitRon
Copy link

GitRon commented Sep 16, 2020

Cool! Does this mean an update will fix the issue? Or when is a release planned? Thanks!

@agusmakmun
Copy link
Owner

@GitRon now martor supported with bootstrap and semantic ui themes.
you can checkout this example martor_demo/app/templates or in readme

you can easily select the theme in your settings.py, e.g:

# Choices are: "semantic", "bootstrap"
MARTOR_THEME = 'bootstrap'

Please upgrade for newest version;

pip install martor --upgrade

@GitRon
Copy link

GitRon commented Sep 25, 2020

Actually, this makes things worse. I crashes the layout of my base page including navigation. With semantic I just see wrong fonts and colors 😔

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

Successfully merging a pull request may close this issue.

6 participants