Browse Source

Modified css to work with built-in highlighting.

master
J David Smith 9 years ago
parent
commit
300434aa29
  1. 18
      scripts/highlight.js
  2. 118
      source/css/solarized_light.css

18
scripts/highlight.js

@ -1,18 +0,0 @@
var hljs = require('highlight.js'),
jsdom = require('jsdom');
hexo.extend.filter.register('after_post_render', function(data) {
var document = jsdom.jsdom(data.content);
var codes = document.querySelectorAll('pre code');
Array.prototype.forEach.call(codes, function(code) {
if(code.className === 'plain') {
return;
} else if(code.className) {
code.innerHTML = hljs.highlight(code.className, code.innerHTML).value;
} else {
code.innerHTML = hljs.highlightAuto(code.innerHTML).value;
}
});
data.content = jsdom.serializeDocument(document);
});

118
source/css/solarized_light.css

@ -13,95 +13,95 @@ Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmai
-webkit-text-size-adjust: none; -webkit-text-size-adjust: none;
} }
.hljs-comment,
.diff .hljs-header,
.hljs-doctype,
.hljs-pi,
.lisp .hljs-string {
.code .comment,
.code .diff .header,
.code .doctype,
.code .pi,
.code .lisp .string {
color: #93a1a1; color: #93a1a1;
} }
/* Solarized Green */ /* Solarized Green */
.hljs-keyword,
.hljs-winutils,
.method,
.hljs-addition,
.css .hljs-tag,
.hljs-request,
.hljs-status,
.nginx .hljs-title {
.code .keyword,
.code .winutils,
.code .method,
.code .addition,
.code .css .tag,
.code .request,
.code .status,
.code .nginx .title {
color: #859900; color: #859900;
} }
/* Solarized Cyan */ /* Solarized Cyan */
.hljs-number,
.hljs-command,
.hljs-string,
.hljs-tag .hljs-value,
.hljs-rule .hljs-value,
.hljs-doctag,
.tex .hljs-formula,
.hljs-regexp,
.hljs-hexcolor,
.hljs-link_url {
.code .number,
.code .command,
.code .string,
.code .tag .value,
.code .rule .value,
.code .doctag,
.code .tex .formula,
.code .regexp,
.code .hexcolor,
.code .link_url {
color: #2aa198; color: #2aa198;
} }
/* Solarized Blue */ /* Solarized Blue */
.hljs-title,
.hljs-localvars,
.hljs-chunk,
.hljs-decorator,
.hljs-built_in,
.hljs-identifier,
.vhdl .hljs-literal,
.hljs-id,
.css .hljs-function,
.hljs-name {
.code .title,
.code .localvars,
.code .chunk,
.code .decorator,
.code .built_in,
.code .identifier,
.code .vhdl .literal,
.code .id,
.code .css .function,
.code .name {
color: #268bd2; color: #268bd2;
} }
/* Solarized Yellow */ /* Solarized Yellow */
.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.smalltalk .hljs-number,
.hljs-constant,
.hljs-class .hljs-title,
.hljs-parent,
.hljs-type,
.hljs-link_reference {
.code .attribute,
.code .variable,
.code .lisp .body,
.code .smalltalk .number,
.code .constant,
.code .class .title,
.code .parent,
.code .type,
.code .link_reference {
color: #b58900; color: #b58900;
} }
/* Solarized Orange */ /* Solarized Orange */
.hljs-preprocessor,
.hljs-preprocessor .hljs-keyword,
.hljs-pragma,
.hljs-shebang,
.hljs-symbol,
.hljs-symbol .hljs-string,
.diff .hljs-change,
.hljs-special,
.hljs-attr_selector,
.hljs-subst,
.hljs-cdata,
.css .hljs-pseudo,
.hljs-header {
.code .preprocessor,
.code .preprocessor .keyword,
.code .pragma,
.code .shebang,
.code .symbol,
.code .symbol .string,
.code .diff .change,
.code .special,
.code .attr_selector,
.code .subst,
.code .cdata,
.code .css .pseudo,
.code .header {
color: #cb4b16; color: #cb4b16;
} }
/* Solarized Red */ /* Solarized Red */
.hljs-deletion,
.hljs-important {
.code .deletion,
.code .important {
color: #dc322f; color: #dc322f;
} }
/* Solarized Violet */ /* Solarized Violet */
.hljs-link_label {
.code .link_label {
color: #6c71c4; color: #6c71c4;
} }
.tex .hljs-formula {
.code .tex .formula {
background: #eee8d5; background: #eee8d5;
} }
Loading…
Cancel
Save