-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
CSS conflict with reveal.js #4189
Comments
You would have to override the css for CodeMirror, because reveal css will change/modify the properties of div's and so on. What you would have to alter is as follows: .reveal .CodeMirror-lines {
text-align: left !important;
......
......
} Alter the CSS for getting the result, because, your CodeMirror is inside a reveal div and that will obviously add it's own css, like: .reveal .slides {
position: absolute;
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
overflow: visible;
z-index: 1;
text-align: center; /* Culprit -- changing the alignment */
-webkit-perspective: 600px;
perspective: 600px;
-webkit-perspective-origin: 50% 40%;
perspective-origin: 50% 40%;
} |
Thanks. But my problem is with the less trivial css than
What css should I override to fix that? |
You could try wrapping your editor instances inside web components. That should remove the problems caused by agressive, unscoped CSS in reveal.js. But in general, I'm not taking responsibility for issues like this, produced by outside CSS. You'll just have to find the relevant properties and reset them in your own CSS. |
Per @marijnh suggestion, I've tried to put my editor instance inside a web component but still some CSS is bleeding into the editor:
I know that it is probably an issue with reveal so I am reporting also in reveal repo. Maybe you guys at CodeMirror can think of a workaround? |
Moving with arrows or using space is related in to Reveal.js keyboard bindings. https://github.com/hakimel/reveal.js/blob/master/js/reveal.js#L4201 You need to be able to stop event propagation from CodeMirror editor in to Reveal.js handler. |
It's because https://github.com/hakimel/reveal.js/blob/master/js/reveal.js#L4144
If you inspect DOM in first slide you can see that CodeMirror editor is not directly using input/textarea when content is edited. (if I'm correct) |
I think that reveal.js should have attribute 'reveal-keyboard-off' and code should also check whether the element has that attribute. If it has, keyboard event handler should not do anything on those events. |
Thanks a lot @RopoMen But I'm still having weird issues. For instance, if you put the cursor at the beginning of In general, if you play a bit with arrows and spaces, you will feel that something is really not working well. Do you know why it happens and how coud I solve it? |
I checked and couldn't see any extra characters in DOM after 'c'. That kind of bug sounds like more CodeMirror issue. (Using Chrome) ps. How did you handled those keyboard bindings? Quickly looked in to your example and couldn't find "obvious" solution :) |
I have handled the keyboard binding issue by adding |
@marijnh maybe you can help with this part of the problem that I mentioned above: #4189 (comment) |
I did see that on Reveal rules but I thought that it would not work because I have looked in to web components / custom html elements because to major benefit is the style isolation. |
@RopoMen so why doesn't it work properly yet ? |
@viebel
What I meant was that if you add
Browser is making |
I mean why do we still have this issue #4189 (comment) I'm so frustrated: we are so close but still not there! |
@viebel I think I found something! |
Actually, it's a little more complicated than what I described above. |
@viebel O.K. I got it to work... |
I'm trying to have codemirror on my slides with reveal.js and there seems to be a css conflict.
Look at this page that reproduces the issue: http://viebel.github.io/klipse/misc/reveal-codemirror.html.
There are a couple of issues:
The text was updated successfully, but these errors were encountered: