improve styling

This commit is contained in:
Philipp Kühn
2020-03-06 12:04:35 +01:00
parent 699e5a85b6
commit 1dea0299ec
3 changed files with 13 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
</div>
<div class="demo__source">
<div v-for="(file, index) in files" :key="index">
<p>
<p v-if="showFileNames">
{{ file.name }}
</p>
<pre :class="`language-${file.highlight}`"><code :class="`language-${file.highlight}`" v-html="$options.filters.highlight(file.content, file.highlight)"></code></pre>
@@ -45,6 +45,10 @@ export default {
return require(`~/demos/${file.path}`).default
},
showFileNames() {
return this.files.length > 1
},
},
mounted() {

View File

@@ -11,5 +11,9 @@
padding: 1rem;
background-color: $colorBlack;
color: $colorWhite;
code, pre {
padding: 0;
}
}
}

View File

@@ -47,4 +47,8 @@ body {
*:focus {
outline: none;
}
:not(pre) > code[class*="language-"], pre[class*="language-"] {
background-color: $colorBlack;
}
</style>