Skip to content

Commit

Permalink
添加markdown表格样式
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 3, 2015
1 parent 3e76db4 commit 7281c7e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 22 deletions.
22 changes: 21 additions & 1 deletion themes/default/css/MDEditor.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
background: #6e6e6e;
font-style: inherit;
cursor: pointer;
padding: 3px 4px;
padding: 1px 4px;
border-radius: 3px;
color: #fff;
}
Expand Down Expand Up @@ -180,3 +180,23 @@
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown_body table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
max-width: 100%;
display: block;
background-color: transparent;
}
.markdown_body table th,
.markdown_body table td {
border: 1px solid #ddd;
padding: 4px 10px;
}
.markdown_body table th {
font-weight: bold;
background: #f3f3f3;
}
.markdown_body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
57 changes: 36 additions & 21 deletions themes/default/stylus/MDEditor.styl
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ min-height=200px
background: #6E6E6E
font-style: inherit
cursor: pointer
padding: 3px 4px
padding: 1px 4px
border-radius: 3px
color: #fff;
color: #fff
&:hover
background:#009EFF
&:active
Expand All @@ -71,11 +71,11 @@ min-height=200px

.markdown_body
background:#fff
word-wrap: break-word;
overflow: hidden;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word
overflow: hidden
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif
font-size: 16px
line-height: 1.6
&>*:first-child
margin-top: 0 !important

Expand All @@ -96,26 +96,26 @@ min-height=200px
line-height: 1.225
border-bottom:1px dashed #eee
blockquote
padding: 0 15px;
color: #777;
padding: 0 15px
color: #777
border-left: 4px solid #ddd
margin: 0;
&>:last-child
margin-bottom: 0;
margin-bottom: 0
&>:first-child
margin-top: 0;
margin-top: 0
p,blockquote,ul,ol,dl,table,pre
margin-top: 0;
margin-bottom: 16px;
margin-bottom: 16px
ul,ol
padding-left: 2em;
padding-left: 2em
pre
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
padding: 16px
overflow: auto
font-size: 85%
line-height: 1.45
background-color: #f7f7f7
border-radius: 3px
code
background-color:transparent
color: inherit;
Expand All @@ -133,5 +133,20 @@ min-height=200px
border-radius: 3px
color: #c7254e;
code:before,code:after,tt:before,tt:after
letter-spacing: -0.2em;
content: "\00a0";
letter-spacing: -0.2em
content: "\00a0"
table
width: 100%
border-collapse: collapse
border-spacing: 0
max-width: 100%
display: block
background-color: transparent
th,td
border: 1px solid #ddd
padding: 4px 10px
th
font-weight: bold
background: #F3F3F3
tr:nth-child(2n)
background-color: #f8f8f8;

0 comments on commit 7281c7e

Please sign in to comment.