Skip to content

Commit

Permalink
docs(*): style
Browse files Browse the repository at this point in the history
  • Loading branch information
olivewind committed Oct 12, 2018
1 parent 966b7bc commit 71fa2c0
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 36 deletions.
2 changes: 2 additions & 0 deletions examples/plugins/codemirror/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'codemirror/mode/javascript/javascript';
import 'codemirror/mode/css/css';
import 'codemirror/lib/codemirror.css';
import 'codemirror/theme/monokai.css';
import 'codemirror/theme/3024-day.css';


Vue.use(VueCodemirror);

19 changes: 17 additions & 2 deletions examples/view/components/code-block/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default {
type: Boolean,
default: false,
},
theme: {
type: String,
default: 'monokai',
},
},
data() {
return {
Expand All @@ -35,7 +39,7 @@ export default {
tabSize: 2,
readOnly: this.readOnly,
mode: 'text/x-vue',
theme: 'monokai',
theme: this.theme,
};
switch (this.type) {
case 'vue':
Expand Down Expand Up @@ -69,10 +73,21 @@ export default {
.code-block{
.CodeMirror{
height: auto;
padding: 6px 20px;
padding: 4px 8px;
}
.CodeMirror-line {
font-family: SF Mono,Monaco,Inconsolata,Fira Mono,Droid Sans Mono,Source Code Pro,monospace !important;
}
.cm-s-monokai{
background-color: #153656;
}
.cm-s-3024-day{
.cm-def{
color: #01a252;
}
span.cm-string{
color: rgb(102, 153, 0);
}
}
}
</style>
7 changes: 6 additions & 1 deletion examples/view/components/code-reader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<code-block
:type="type"
:readOnly="readOnly"
:code="code">
:code="code"
:theme="theme">
</code-block>
</div>
</template>
Expand All @@ -24,6 +25,10 @@ export default {
type: Boolean,
default: false,
},
theme: {
type: String,
default: 'monokai',
},
},
data() {
return {
Expand Down
12 changes: 4 additions & 8 deletions examples/view/components/demo-code/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ export default {

<style lang="scss" scoped>
@import 'daoColor';
$padding : 20px;
$padding : 12px;
.demo-code{
border: 1px solid #ebebeb;
border-radius: 5px;
transition: .2s;
border-radius: 4px;
transition: all .08s ease-in-out;
overflow: hidden;
transition: all .1s ease-in-out;
background-color: $white-light;
box-shadow: 0 1px 4px rgba(204, 209, 217, 0.3);
.header{
padding: 10px $padding;
padding: $padding;
cursor: pointer;
user-select: none;
font-size: 12px;
Expand All @@ -51,7 +48,6 @@ $padding : 20px;
background-color: #1f4160;
.header{
color: #FFF;
font-weight: 600;
}
}
.desc{
Expand All @@ -64,7 +60,7 @@ $padding : 20px;
.wrap{
padding: $padding;
background-color: $white;
border-radius: 3px;
border-radius: 4px;
box-shadow: 0 0 0 1px rgba(67,90,111,.146);
}
}
Expand Down
8 changes: 3 additions & 5 deletions examples/view/components/docs-section/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="docs-section">
<div class="title" slot="section-title" v-if="$slots['title']"><slot name="title"></slot></div>
<div class="helper" slot="section-title-helper"><slot name="helper"></slot></div>
<div class="helper" slot="section-title-helper" v-if="$slots.helper"><slot name="helper"></slot></div>
<div class="content" slot="content" v-if="$slots.content"><slot name="content"></slot></div>
</div>
</template>
Expand All @@ -22,12 +22,10 @@ export default {
font-weight: 500;
}
&>.helper{
padding: 6px 0;
color: $grey-dark;
border-bottom: 1px solid $white-dark;
padding: 5px 0;
}
&>.content{
padding: 20px 0;
padding: 10px 0;
overflow: auto;
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/view/components/docs-table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default {
color: $blue;
}
.option{
width: 300px;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down
9 changes: 5 additions & 4 deletions examples/view/components/docs-title/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div class="docs-title">
<h2 :class="size">{{name}}</h2>
<div class="desc">
<div class="desc" v-if="$slots.content || desc">
<slot name="desc">
<div v-if="desc"><md-reader>{{desc}}</md-reader></div>
<div><md-reader>{{desc}}</md-reader></div>
</slot>
</div>
</div>
Expand Down Expand Up @@ -39,16 +39,17 @@ export default {
font-size: 18px;
}
&.md{
font-size: 24px;
font-size: 22px;
}
&.lg{
font-size: 32px;
font-size: 28px;
}
}
.desc{
color: $grey-dark;
font-size: 14px;
font-weight: normal;
padding-top: 4px;
}
}
</style>
2 changes: 1 addition & 1 deletion examples/view/page/change-logs/change-log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
border-radius: 4px;
padding: 20px;
h2{
margin: 30px 0px 20px 0px;
margin: 20px 0px;
}
li{
margin: 10px 0;
Expand Down
14 changes: 5 additions & 9 deletions examples/view/page/components/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,19 @@ export default {
height: 100%;
overflow: auto;
width: 100%;
padding: 20px 10px;
padding: 20px;
.view-wrap{
margin: 0 auto;
@media (max-width: 768px) {
padding: 10px;
width: calc(100% - 40px);
}
@media (min-width: 768px) {
padding: 0px 40px;
width: calc(100% - 120px);
}
@media (min-width: 1100px) {
&.not-component{
width: 800px;
margin: 0 auto;
}
width: calc(100% - 300px);
}
margin: 0 auto;
color: #5e6d82;
}
}
Expand Down
10 changes: 5 additions & 5 deletions examples/view/page/installation/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
<docs-section>
<template slot="title">1. {{$t('installationPage.use_npm')}}</template>
<template slot="content">
<code-reader readOnly file="installation/demo-1.sh"></code-reader>
<code-reader readOnly theme="3024-day" file="installation/demo-1.sh"></code-reader>
<br>
<code-reader readOnly type="javascript" file="installation/demo-4.js"></code-reader>
<code-reader readOnly theme="3024-day" type="javascript" file="installation/demo-4.js"></code-reader>
</template>
</docs-section>
<docs-section>
<template slot="title">2. {{$t('installationPage.use_html')}}</template>
<template slot="content">
<code-reader readOnly file="installation/demo-2.html"></code-reader>
<code-reader readOnly theme="3024-day" file="installation/demo-2.html"></code-reader>
</template>
</docs-section>
<docs-section>
<template slot="title">
<docs-title :name="$t('installationPage.usage')" size="sm"></docs-title>
<docs-title :name="$t('installationPage.usage')" size="lg"></docs-title>
</template>
<template slot="content">
<code-reader readOnly file="installation/demo-3.vue"></code-reader>
<code-reader readOnly theme="3024-day" file="installation/demo-3.vue"></code-reader>
</template>
</docs-section>
</div>
Expand Down

0 comments on commit 71fa2c0

Please sign in to comment.