Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: improve editor style in vuepress #717

Merged
merged 1 commit into from
Dec 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: improve editor style in vuepress
armano2 committed Dec 8, 2018

Unverified

This user has not yet uploaded their public signing key.
commit a784f1189af54f76fc6d1fc1f774f04a031642c3
44 changes: 28 additions & 16 deletions docs/.vuepress/components/eslint-code-block.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<template>
<eslint-editor
:linter="linter"
:config="config"
:code="code"
:style="{ height }"
class="eslint-code-block"
filename="example.vue"
language="html"
:preprocess="preprocess"
:postprocess="postprocess"
dark
:format="format"
:fix="fix"
/>
<div class="eslint-code-container">
<eslint-editor
:linter="linter"
:config="config"
:code="code"
:style="{ height }"
class="eslint-code-block"
filename="example.vue"
language="html"
:preprocess="preprocess"
:postprocess="postprocess"
dark
:format="format"
:fix="fix"
/>
</div>
</template>

<script>
@@ -92,7 +94,7 @@ export default {
height () {
const lines = this.code.split('\n').length
return `${Math.max(120, 20 * (1 + lines))}px`
return `${Math.max(120, 19 * lines)}px`
}
},
@@ -129,8 +131,18 @@ export default {
</script>

<style>
.eslint-code-container {
border-radius: 6px;
padding: 1.25rem 0;
margin: 1em 0;
background-color: #1e1e1e;
}
.eslint-code-block {
width: 100%;
margin: 1em 0;
}
.eslint-editor-actions {
bottom: -0.9rem;
}
</style>