Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Removed extraneous font-family mentions of Ubuntu Mono.
Browse files Browse the repository at this point in the history
I used the following code to ensure that the rules I excised
font-family declarations from still inherited Ubuntu Mono from
parent nodes:

(function(jQuery) {
  var $ = jQuery;

  function test(name, selectors, css) {
    console.log("CSS test: " + name);
    selectors.forEach(function(selector) {
      var passed = 0;
      var elements = $(selector);
      if (!elements.length)
        return console.error("  FAIL - nothing matches " + selector);
      elements.each(function() {
        var $el = $(this);
        for (var property in css) {
          var value = $el.css(property);
          if (!value.match(css[property]))
            return console.error("  FAIL - " + selector + " " + property +
                                 " is " + value + ", not " + css[property]);
        }
        passed++;
      });
      if (elements.length == passed)
        console.log("  OK    - " + selector + " (" + passed + ")");
    });
  }

  test("font is Ubuntu Mono", [
    ".CodeMirror", ".CodeMirror-lines", ".CodeMirror textarea",
    ".CodeMirror-gutter-text", ".cm-s-jsbin span.cm-comment"
  ], {
    'font-family': /Ubuntu Mono/
  });
})(jQuery);
  • Loading branch information
toolness committed Aug 16, 2012
1 parent 42edd41 commit 1da86b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions css/jsbin-codemirror-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
}

.CodeMirror .CodeMirror-lines {
font-family: 'Ubuntu Mono', monospace;
color: #333;
font-size: 14px;
line-height: 15.75px;
Expand All @@ -43,7 +42,6 @@
}

.CodeMirror-gutter-text {
font-family: 'Ubuntu Mono', monospace;
color: #A9A9A9;
font-size: 12px;
line-height: 15.75px;
Expand All @@ -54,11 +52,13 @@
}

.cm-s-jsbin span.cm-comment {
font-family: 'Ubuntu Mono', monospace;
color: #333;
font-style: italic;
font-weight: bold;
line-height: 15.75px; /* needs to be a little less than the standard line-height to align on multi-line wrapped content */

/* This needs to be a little less than the standard line-height to align on
multi-line wrapped content. */
line-height: 15.75px;
}

.CodeMirror-wrap .CodeMirror-scroll {
Expand Down

1 comment on commit 1da86b8

@toolness
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the test script for this refactoring to a separate gist.

Please sign in to comment.