Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Protect against 'you must use border-box' #2210

Closed
wants to merge 1 commit into from

2 participants

@polkovnikov-ph

No description provided.

@marijnh
Owner

I don't like using .something * rules very much. Is there a specific problem you are addressing with these? Could we fix it with specialized rules?

@polkovnikov-ph
@marijnh marijnh referenced this pull request from a commit
@marijnh marijnh Fix another case of bootstrap blues
(Border-sizing on the CodeMirror-linenumber class)

Issue #2210
bed5c81
@marijnh
Owner

I agree that yes, this'll mess with 3rd party code. But so would your patch, since a widget expecting bootstrap-style border boxes might be present inside a widget in a CodeMirror editor. There is no perfect solution here (except for Bootstrap changing their approach, which seems unlikely). The reason I dislike blanket * rules is that they tend to produce unexpected effects.

Does attached patch, and the understanding that 3rd party code will have to fix this for themselves, work for you?

@GerHobbelt GerHobbelt referenced this pull request from a commit in GerHobbelt/CodeMirror2
@marijnh marijnh Fix another case of bootstrap blues
(Border-sizing on the CodeMirror-linenumber class)

Issue #2210
65eda91
@marijnh marijnh closed this
@anaran anaran referenced this pull request from a commit in anaran/CodeMirror
@marijnh marijnh Fix another case of bootstrap blues
(Border-sizing on the CodeMirror-linenumber class)

Issue #2210
69e0c18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 1, 2014
  1. @polkovnikov-ph
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/codemirror.css
View
8 lib/codemirror.css
@@ -5,6 +5,14 @@
font-family: monospace;
height: 300px;
}
+
+.CodeMirror *, .CodeMirror *:before, .CodeMirror *:after {
+ /* Protect against "you must use border-box" */
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+}
+
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow: auto;
Something went wrong with that request. Please try again.