Skip to content

Commit f90696d

Browse files
authored
Merge pull request #6 from vue-styleguidist/feature/css
feat(css design improvment)
2 parents e7a04e5 + afe75e7 commit f90696d

File tree

4 files changed

+40
-28
lines changed

4 files changed

+40
-28
lines changed

docs/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ Vuepress-live allows you to make your examples more interactive automatically. F
44

55
## Make example live
66

7-
Writing this in your markdown
7+
Writing this in your markdown...
88

99
<pre><code>```vue live
1010
&lt;button&gt;example&lt;/button&gt;
1111
```
1212
</code></pre>
1313

14-
will have this result... Go ahead, edit the part on the left. The right side has changed.
14+
...will have this result.
15+
16+
Go ahead! edit the part on the left. The right side has changed.
1517

1618
```html live
1719
<button>example</button>
1820
```
1921

22+
You can continue using non-rendered code if you don't add `live`
23+
24+
```html
25+
<button>example</button>
26+
```
27+
2028
## Showcase components
2129

2230
Using the [@vuepress/register-components](https://www.npmjs.com/package/@vuepress/plugin-register-components) plugin, one can load components in their vuepress site. Since they are now available they can now be showcased.

layout.vue

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,59 @@
11
<template functional>
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>
1213
.preview-code {
1314
display: flex;
14-
flex-direction: row-reverse;
15+
flex-flow: row-reverse wrap;
1516
border-radius: 6px;
16-
border: 1px solid #ccc;
17+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
18+
0 4px 6px -2px rgba(0, 0, 0, 0.05);
1719
overflow: hidden;
1820
}
1921
20-
.editor {
21-
width: 100%;
22-
background-color: #2d2d2d;
22+
.preview-code .block {
23+
flex-grow: 1;
24+
width: 50%;
2325
}
2426
25-
.preview {
26-
width: 100%;
27-
padding: 12px;
28-
background-color: #fff;
27+
.preview-code .editor .prism-editor-wrapper {
28+
height: 100%;
29+
}
30+
31+
.preview-code .editor pre {
32+
margin: 0;
33+
box-sizing: border-box;
34+
height: 100%;
35+
border-radius: 0;
36+
}
37+
38+
.preview-code .preview {
39+
background-color: rgb(249, 245, 245);
2940
text-align: center;
41+
box-sizing: border-box;
42+
padding: 12px;
3043
}
3144
3245
@media only screen and (max-width: 568px) {
3346
.preview-code {
3447
display: block;
3548
}
36-
37-
.preview-code > div {
49+
.preview-code .block {
3850
width: auto;
3951
}
4052
}
41-
4253
@media only screen and (max-width: 419px) {
4354
.preview-code {
4455
margin: 0.85rem -1.5rem;
4556
border-radius: 0;
4657
}
4758
}
4859
</style>
49-
50-
<style>
51-
.content .preview-code .editor pre {
52-
border-radius: 0;
53-
margin: 0;
54-
}
55-
</style>

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"validate-commit-msg": "^2.14.0"
3434
},
3535
"dependencies": {
36-
"vue-live": "^0.4.6"
36+
"vue-live": "^0.4.8"
3737
}
3838
}

0 commit comments

Comments
 (0)