Skip to content

Commit 5a3e636

Browse files
f3ltronBarthelemy Ledoux
authored andcommitted
feat(layout): improve design
1 parent e7a04e5 commit 5a3e636

File tree

2 files changed

+31
-34
lines changed

2 files changed

+31
-34
lines changed

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ let value = 72;
2828

2929
<div>value: {{ value }}</div>
3030
<vue-slider
31-
style="margin: 20px 0;"
31+
style="
32+
margin: 20px 0;
33+
width: 100%;"
3234
v-model="value"
3335
:order="false"
3436
/>

layout.vue

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,50 @@
1-
<template functional>
1+
<template>
22
<div class="preview-code">
3-
<div class="preview">
3+
<div class="preview block">
44
<slot name="preview"></slot>
55
</div>
6-
<div class="editor">
6+
<div class="editor block">
77
<slot name="editor"></slot>
88
</div>
99
</div>
1010
</template>
11-
<style scoped>
11+
12+
<style>
13+
.no-focus {
14+
outline: none !important;
15+
}
16+
1217
.preview-code {
1318
display: flex;
14-
flex-direction: row-reverse;
19+
flex-flow: row-reverse wrap;
1520
border-radius: 6px;
16-
border: 1px solid #ccc;
17-
overflow: hidden;
21+
border: 1px solid rgb(247, 247, 247);
22+
box-shadow: 0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)!important;
1823
}
1924
20-
.editor {
21-
width: 100%;
25+
.preview-code .editor {
2226
background-color: #2d2d2d;
27+
overflow: hidden;
2328
}
2429
25-
.preview {
26-
width: 100%;
30+
.preview-code .block {
31+
flex-grow: 1;
2732
padding: 12px;
28-
background-color: #fff;
29-
text-align: center;
30-
}
31-
32-
@media only screen and (max-width: 568px) {
33-
.preview-code {
34-
display: block;
35-
}
36-
37-
.preview-code > div {
38-
width: auto;
39-
}
4033
}
4134
42-
@media only screen and (max-width: 419px) {
43-
.preview-code {
44-
margin: 0.85rem -1.5rem;
45-
border-radius: 0;
46-
}
35+
.preview-code .preview {
36+
background-color: rgb(249, 245, 245);
37+
text-align: center;
38+
min-width: 40%;
4739
}
4840
</style>
4941

50-
<style>
51-
.content .preview-code .editor pre {
52-
border-radius: 0;
53-
margin: 0;
42+
<script>
43+
export default {
44+
mounted() {
45+
this.$nextTick(() => {
46+
document.querySelectorAll('pre').forEach(e => e.classList.add('no-focus'))
47+
}, 100)
48+
}
5449
}
55-
</style>
50+
</script>

0 commit comments

Comments
 (0)