change prism highlighting

This commit is contained in:
Philipp Kühn 2020-04-17 23:35:07 +02:00
parent 7a17adcc84
commit 71e1e20e01
7 changed files with 228 additions and 15 deletions

View File

@ -53,6 +53,7 @@ export default {
jsx: 'jsx',
vue: 'markup',
css: 'css',
scss: 'scss',
},
}
},

View File

@ -14,17 +14,17 @@
}
&__source {
background-color: $colorLightGrey;
background-color: $colorBlack;
}
&__tabs {
padding: 0 1.5rem;
border-bottom: 1px solid rgba($colorBlack, 0.05);
border-bottom: 2px solid rgba($colorWhite, 0.1);
}
&__tab {
position: relative;
color: rgba($colorBlack, 0.5);
color: rgba($colorWhite, 0.5);
font: inherit;
font-weight: 500;
padding: 0.75rem 0;
@ -34,16 +34,16 @@
margin-right: 1rem;
&.is-active {
color: $colorBlack;
color: $colorWhite;
&::after {
content: '';
position: absolute;
bottom: -1px;
bottom: -2px;
left: 0;
width: 100%;
height: 2px;
background-color: $colorBlack;
background-color: $colorWhite;
}
}
}
@ -54,11 +54,5 @@
code, pre {
padding: 0;
}
[class*="language-"] {
background: none;
border: none;
box-shadow: none;
}
}
}

View File

@ -3,7 +3,7 @@ title: Install
slug: install
---
```
```bash
# Using npm
npm install @tiptap/core

View File

@ -73,4 +73,4 @@ p {
.is-active {
background: black;
color: white;
}
}

View File

@ -47,4 +47,5 @@ query {
<style lang="scss" src="./fonts.scss"></style>
<style lang="scss" src="./base.scss" />
<style lang="scss" src="./prism.scss"></style>
<style lang="scss" src="./style.scss" scoped />

View File

@ -0,0 +1,217 @@
$codeBg: $colorBlack;
code[class*="language-"], pre[class*="language-"] {
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
hyphens: none;
color: inherit;
text-shadow: none;
font-family: 'Fira Code', monospace;
font-size: 1em;
line-height: 1.8;
tab-size: 2;
}
code[class*="language-"]::-moz-selection, pre[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection,
pre[class*="language-"] ::-moz-selection {
text-shadow: none;
opacity: 1;
color: #eee;
background: #363636;
}
code[class*="language-"]::selection, pre[class*="language-"]::selection,
code[class*="language-"] ::selection,
pre[class*="language-"] ::selection {
text-shadow: none;
opacity: 1;
color: #eee;
background: #363636;
}
@media print {
code[class*="language-"], pre[class*="language-"] {
text-shadow: none !important;
}
}
:not(pre) > code[class*="language-"] {
white-space: normal;
color: #eee;
background: $codeBg;
border-radius: 0.2em;
padding: 0.1em;
}
pre > code[class*="language-"] {
background: none;
}
pre[class*="language-"] {
overflow: auto;
position: relative;
color: #eee;
background: $codeBg;
border-radius: 0;
margin: 0.5em 0;
padding: 1.25em 1em;
border-radius: 12px;
}
pre[class*="language-"].language-css > code, pre[class*="language-"].language-sass > code, pre[class*="language-"].language-scss > code {
color: #fd9170;
}
[class*="language-"] .namespace {
opacity: 0.7;
}
.token.atrule {
color: #c792ea;
}
.token.attr-name {
color: #ffcb6b;
}
.token.attr-value {
color: #a5e844;
}
.token.attribute {
color: #a5e844;
}
.token.boolean {
color: #c792ea;
}
.token.builtin {
color: #ffcb6b;
}
.token.cdata {
color: #80cbc4;
}
.token.char {
color: #80cbc4;
}
.token.class {
color: #ffcb6b;
}
.token.class-name {
color: #f2ff00;
}
.token.comment {
color: #616161;
}
.token.constant {
color: #c792ea;
}
.token.deleted {
color: #ff6666;
}
.token.doctype {
color: #616161;
}
.token.entity {
color: #ff6666;
}
.token.function {
color: #c792ea;
}
.token.hexcode {
color: #f2ff00;
}
.token.id {
color: #c792ea;
font-weight: bold;
}
.token.important {
color: #c792ea;
font-weight: bold;
}
.token.inserted {
color: #80cbc4;
}
.token.keyword {
color: #c792ea;
}
.token.number {
color: #fd9170;
}
.token.operator {
color: #89ddff;
}
.token.prolog {
color: #616161;
}
.token.property {
color: #80cbc4;
}
.token.pseudo-class {
color: #a5e844;
}
.token.pseudo-element {
color: #a5e844;
}
.token.punctuation {
color: #89ddff;
}
.token.regex {
color: #f2ff00;
}
.token.selector {
color: #ff6666;
}
.token.string {
color: #a5e844;
}
.token.symbol {
color: #c792ea;
}
.token.tag {
color: #ff6666;
}
.token.unit {
color: #fd9170;
}
.token.url {
color: #ff6666;
}
.token.variable {
color: #ff6666;
}

View File

@ -1,6 +1,6 @@
import Prism from 'prismjs'
import 'prismjs/themes/prism-coy.css'
import 'prismjs/components/prism-jsx.js'
import 'prismjs/components/prism-scss.js'
import App from '~/layouts/App'
import Demo from '~/components/Demo'
import Tab from '~/components/Tab'