diff options
author | Julio Capote <jcapote@gmail.com> | 2018-11-06 02:49:16 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2018-11-06 02:49:16 +0000 |
commit | a62a3e7755579d93ce3a87243dd277575930fffe (patch) | |
tree | 6d074f7294c5b7a45bed7ac229a6802830da2a04 /themes/even/src/css/_partial/_post/_code.scss | |
download | capotej.com-a62a3e7755579d93ce3a87243dd277575930fffe.tar.gz |
init
Diffstat (limited to 'themes/even/src/css/_partial/_post/_code.scss')
-rw-r--r-- | themes/even/src/css/_partial/_post/_code.scss | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/themes/even/src/css/_partial/_post/_code.scss b/themes/even/src/css/_partial/_post/_code.scss new file mode 100644 index 0000000..2a23a77 --- /dev/null +++ b/themes/even/src/css/_partial/_post/_code.scss @@ -0,0 +1,140 @@ +code, pre { + padding: 7px; + font-size: $code-font-size; + font-family: $code-font-family; + background: $code-background; +} + +code { + padding: 3px 5px; + border-radius: 4px; + color: $code-color; +} + +figure.highlight { + margin: 1em 0; + border-radius: 5px; + overflow-x: auto; + box-shadow: 1px 1px 2px rgba(0,0,0,0.125); + position: relative; + + table { + position: relative; + + &::after { + position: absolute; + top: 0; + right: 0; + left: 0; + padding: 2px 7px; + font-size: $code-font-size; + font-weight: bold; + color: darken($gray, 10%); + background: darken($code-background, 3%); + content: 'Code'; + } + } + + @each $sign, $text in $code-type-list { + &.#{$sign} > table::after { + content: $text; + } + } + + .code { + pre { + margin: 0; + padding: 30px 10px 10px; + } + } + + .gutter { + width: 10px; + color: $gray; + + pre { + margin: 0; + padding: 30px 7px 10px; + } + } + + .line { + // Fix code block null line height and + // Synchronous gutter and code line highly. + height: round($code-font-size * 1.5); + } + + table, tr, td { + margin: 0; + padding: 0; + width: 100%; + border-collapse: collapse; + } + + .code { + .hljs-comment, + .hljs-quote { + color: map-get($code-highlight-color, comment); + } + + .hljs-keyword, + .hljs-selector-tag, + .hljs-addition { + color: map-get($code-highlight-color, keyword); + } + + .hljs-number, + .hljs-string, + .hljs-meta .hljs-meta-string, + .hljs-literal, + .hljs-doctag, + .hljs-regexp { + color: map-get($code-highlight-color, number); + } + + .hljs-title, + .hljs-section, + .hljs-name, + .hljs-selector-id, + .hljs-selector-class { + color: map-get($code-highlight-color, title); + } + + .hljs-attribute, + .hljs-attr, + .hljs-variable, + .hljs-template-variable, + .hljs-class .hljs-title, + .hljs-type { + color: map-get($code-highlight-color, attribute); + } + + .hljs-symbol, + .hljs-bullet, + .hljs-subst, + .hljs-meta, + .hljs-meta .hljs-keyword, + .hljs-selector-attr, + .hljs-selector-pseudo, + .hljs-link { + color: map-get($code-highlight-color, symbol); + } + + .hljs-built_in, + .hljs-deletion { + color: map-get($code-highlight-color, built_in); + } + + .hljs-formula { + background: map-get($code-highlight-color, formula); + } + + .hljs-emphasis { + font-style: italic; + } + + .hljs-strong { + font-weight: bold; + } + } +} |