improve styling
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="demo__source">
|
<div class="demo__source">
|
||||||
<div v-for="(file, index) in files" :key="index">
|
<div v-for="(file, index) in files" :key="index">
|
||||||
<p>
|
<p v-if="showFileNames">
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
</p>
|
</p>
|
||||||
<pre :class="`language-${file.highlight}`"><code :class="`language-${file.highlight}`" v-html="$options.filters.highlight(file.content, file.highlight)"></code></pre>
|
<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
|
return require(`~/demos/${file.path}`).default
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showFileNames() {
|
||||||
|
return this.files.length > 1
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -11,5 +11,9 @@
|
|||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
background-color: $colorBlack;
|
background-color: $colorBlack;
|
||||||
color: $colorWhite;
|
color: $colorWhite;
|
||||||
|
|
||||||
|
code, pre {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,4 +47,8 @@ body {
|
|||||||
*:focus {
|
*:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"], pre[class*="language-"] {
|
||||||
|
background-color: $colorBlack;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user