|
| 1 | +/** |
| 2 | + * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); |
| 3 | + * @author Tim Shedor |
| 4 | + * @jezdean for the microbit version |
| 5 | + */ |
| 6 | + |
| 7 | +code[class*="language-"], pre[class*="language-"] { |
| 8 | + color: black; |
| 9 | + background: none; |
| 10 | + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; |
| 11 | + text-align: left; |
| 12 | + white-space: pre; |
| 13 | + word-spacing: normal; |
| 14 | + word-break: normal; |
| 15 | + word-wrap: normal; |
| 16 | + line-height: 1.5; |
| 17 | + -moz-tab-size: 4; |
| 18 | + -o-tab-size: 4; |
| 19 | + tab-size: 4; |
| 20 | + -webkit-hyphens: none; |
| 21 | + -moz-hyphens: none; |
| 22 | + -ms-hyphens: none; |
| 23 | + hyphens: none; |
| 24 | +} |
| 25 | + |
| 26 | +/* Code blocks */ |
| 27 | + |
| 28 | +pre[class*="language-"] { |
| 29 | + position: relative; |
| 30 | + margin: .5em 0; |
| 31 | + -webkit-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; |
| 32 | + -moz-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; |
| 33 | + box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; |
| 34 | + border-left: 10px solid #358ccb; |
| 35 | + background-color: #fdfdfd; |
| 36 | + background-image: -webkit-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); |
| 37 | + background-image: -moz-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); |
| 38 | + background-image: -ms-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); |
| 39 | + background-image: -o-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); |
| 40 | + background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); |
| 41 | + background-size: 3em 3em; |
| 42 | + background-origin: content-box; |
| 43 | + overflow: visible; |
| 44 | + padding: 0; |
| 45 | +} |
| 46 | +code[class*="language"] { |
| 47 | + max-height: inherit; |
| 48 | + height: 100%; |
| 49 | + padding: 0 1em; |
| 50 | + display: block; |
| 51 | + overflow: auto; |
| 52 | +} |
| 53 | + |
| 54 | +/* Margin bottom to accomodate shadow */ |
| 55 | + |
| 56 | +:not(pre) > code[class*="language-"], pre[class*="language-"] { |
| 57 | + background-color: #fdfdfd; |
| 58 | + -webkit-box-sizing: border-box; |
| 59 | + -moz-box-sizing: border-box; |
| 60 | + box-sizing: border-box; |
| 61 | + margin-bottom: 1em; |
| 62 | +} |
| 63 | + |
| 64 | +/* Inline code */ |
| 65 | + |
| 66 | +:not(pre) > code[class*="language-"] { |
| 67 | + position: relative; |
| 68 | + padding: .2em; |
| 69 | + -webkit-border-radius: 0.3em; |
| 70 | + -moz-border-radius: 0.3em; |
| 71 | + -ms-border-radius: 0.3em; |
| 72 | + -o-border-radius: 0.3em; |
| 73 | + border-radius: 0.3em; |
| 74 | + color: #c92c2c; |
| 75 | + border: 1px solid rgba(0, 0, 0, 0.1); |
| 76 | + display: inline; |
| 77 | + white-space: normal; |
| 78 | +} |
| 79 | +pre[class*="language-"]:before, pre[class*="language-"]:after { |
| 80 | + content: ''; |
| 81 | + z-index: -2; |
| 82 | + display: block; |
| 83 | + position: absolute; |
| 84 | + bottom: 0.75em; |
| 85 | + left: 0.18em; |
| 86 | + width: 40%; |
| 87 | + height: 20%; |
| 88 | + max-height: 13em; |
| 89 | + -webkit-box-shadow: 0px 13px 8px #979797; |
| 90 | + -moz-box-shadow: 0px 13px 8px #979797; |
| 91 | + box-shadow: 0px 13px 8px #979797; |
| 92 | + -webkit-transform: rotate(-2deg); |
| 93 | + -moz-transform: rotate(-2deg); |
| 94 | + -ms-transform: rotate(-2deg); |
| 95 | + -o-transform: rotate(-2deg); |
| 96 | + transform: rotate(-2deg); |
| 97 | +} |
| 98 | +:not(pre) > code[class*="language-"]:after, pre[class*="language-"]:after { |
| 99 | + right: 0.75em; |
| 100 | + left: auto; |
| 101 | + -webkit-transform: rotate(2deg); |
| 102 | + -moz-transform: rotate(2deg); |
| 103 | + -ms-transform: rotate(2deg); |
| 104 | + -o-transform: rotate(2deg); |
| 105 | + transform: rotate(2deg); |
| 106 | +} |
| 107 | +.token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata { |
| 108 | + color: #7D8B99; |
| 109 | + s |
| 110 | +} |
| 111 | +.token.punctuation { |
| 112 | + color: #5F6364; |
| 113 | +} |
| 114 | +.token.number { |
| 115 | + color: slateblue; |
| 116 | +} |
| 117 | +.token.property, .token.tag, .token.boolean, .token.function-name, .token.constant, .token.symbol, .token.deleted { |
| 118 | + color: #c92c2c; |
| 119 | +} |
| 120 | +.token.selector, .token.attr-name, .token.string, .token.char, .token.function, .token.builtin, .token.inserted { |
| 121 | + color: #2f9c0a; |
| 122 | +} |
| 123 | +.token.operator, .token.entity, .token.url, .token.variable { |
| 124 | + color: darkcyan; |
| 125 | +} |
| 126 | +.token.atrule, .token.attr-value, .token.keyword, .token.class-name { |
| 127 | + color: deeppink; |
| 128 | + font-weight: bold; |
| 129 | +} |
| 130 | +.token.regex, .token.important { |
| 131 | + color: #e90; |
| 132 | +} |
| 133 | +.language-css .token.string, .style .token.string { |
| 134 | + color: #a67f59; |
| 135 | + background: rgba(255, 255, 255, 0.5); |
| 136 | +} |
| 137 | +.token.important { |
| 138 | + font-weight: normal; |
| 139 | +} |
| 140 | +.token.bold { |
| 141 | + font-weight: bold; |
| 142 | +} |
| 143 | +.token.italic { |
| 144 | + font-style: italic; |
| 145 | +} |
| 146 | +.token.entity { |
| 147 | + cursor: help; |
| 148 | +} |
| 149 | +.namespace { |
| 150 | + opacity: .7; |
| 151 | +} |
| 152 | +@media screen and (max-width: 767px) { |
| 153 | + pre[class*="language-"]:before, pre[class*="language-"]:after { |
| 154 | + bottom: 14px; |
| 155 | + -webkit-box-shadow: none; |
| 156 | + -moz-box-shadow: none; |
| 157 | + box-shadow: none; |
| 158 | + } |
| 159 | +} |
| 160 | + |
| 161 | +/* Plugin styles */ |
| 162 | + |
| 163 | +.token.tab:not(:empty):before, .token.cr:before, .token.lf:before { |
| 164 | + color: #e0d7d1; |
| 165 | +} |
| 166 | + |
| 167 | +/* Plugin styles: Line Numbers */ |
| 168 | + |
| 169 | +pre[class*="language-"].line-numbers { |
| 170 | + padding-left: 0; |
| 171 | +} |
| 172 | +pre[class*="language-"].line-numbers code { |
| 173 | + padding-left: 3.8em; |
| 174 | +} |
| 175 | +pre[class*="language-"].line-numbers .line-numbers-rows { |
| 176 | + left: 0; |
| 177 | +} |
| 178 | + |
| 179 | +/* Plugin styles: Line Highlight */ |
| 180 | + |
| 181 | +pre[class*="language-"][data-line] { |
| 182 | + padding-top: 0; |
| 183 | + padding-bottom: 0; |
| 184 | + padding-left: 0; |
| 185 | +} |
| 186 | +pre[data-line] code { |
| 187 | + position: relative; |
| 188 | + padding-left: 4em; |
| 189 | +} |
| 190 | +pre .line-highlight { |
| 191 | + margin-top: 0; |
| 192 | +} |
0 commit comments