ant-design/site/theme/static/markdown.less
2019-12-24 20:58:42 +08:00

518 lines
10 KiB
Plaintext

.markdown {
color: @site-text-color;
font-size: 14px;
line-height: 2;
}
.highlight {
line-height: 1.5;
}
.markdown img {
max-width: ~'calc(100% - 32px)';
}
.markdown p > img {
margin: 34px 0;
box-shadow: 0 8px 20px rgba(143, 168, 191, 0.35);
}
.markdown p > img.markdown-inline-image {
margin: 0;
box-shadow: none;
}
.markdown h1 {
margin-top: 8px;
margin-bottom: 20px;
color: @site-heading-color;
font-weight: 500;
font-size: 30px;
font-family: Avenir, @font-family, sans-serif;
line-height: 38px;
.subtitle {
margin-left: 12px;
}
}
.markdown h2 {
font-size: 24px;
line-height: 32px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
clear: both;
margin: 1.6em 0 0.6em;
color: @site-heading-color;
font-weight: 500;
font-family: Avenir, @font-family, sans-serif;
}
.markdown h3 {
font-size: 18px;
}
.markdown h4 {
font-size: 16px;
}
.markdown h5 {
font-size: 14px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
clear: both;
height: 1px;
margin: 56px 0;
background: @site-border-color-split;
border: 0;
}
.markdown p,
.markdown pre {
margin: 1em 0;
}
.markdown ul > li {
margin-left: 20px;
padding-left: 4px;
list-style-type: circle;
&:empty {
display: none;
}
}
.markdown ol > li {
margin-left: 20px;
padding-left: 4px;
list-style-type: decimal;
}
.markdown ul > li > p,
.markdown ol > li > p {
margin: 0.2em 0;
}
.markdown code {
margin: 0 1px;
padding: 0.2em 0.4em;
font-size: 0.9em;
border: 1px solid @border-color-split;
background: @site-markdown-code-bg;
border-radius: 3px;
}
.markdown pre {
font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
background: @site-markdown-code-bg;
border-radius: @border-radius-base;
}
.markdown pre code {
margin: 0;
padding: 0;
overflow: auto;
color: @site-text-color;
font-size: @font-size-base - 1px;
background: @site-markdown-code-bg;
border: none;
}
[data-theme='dark'] .markdown {
code,
pre,
pre code {
background: #141414;
}
}
.markdown strong,
.markdown b {
font-weight: 500;
}
.markdown > table {
width: 100%;
margin: 8px 0 16px;
empty-cells: show;
border: 1px solid @site-border-color-split;
border-collapse: collapse;
border-spacing: 0;
}
.markdown > table th {
color: #5c6b77;
font-weight: 500;
white-space: nowrap;
background: rgba(0, 0, 0, 0.02);
}
.markdown > table th,
.markdown > table td {
padding: 16px 24px;
text-align: left;
border: 1px solid @site-border-color-split;
}
.markdown blockquote {
margin: 1em 0;
padding-left: 0.8em;
color: @site-text-color-secondary;
font-size: 90%;
border-left: 4px solid @site-border-color-split;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
margin-left: 8px;
opacity: 0;
transition: opacity 0.3s ease;
}
.markdown .waiting {
color: #ccc;
cursor: not-allowed;
}
.markdown a.edit-button {
display: inline-block;
margin-left: 8px;
text-decoration: none;
i {
color: @site-text-color-secondary;
&:hover {
color: @primary-color;
}
}
.anticon {
display: block;
font-size: 16px;
}
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
display: inline-block;
opacity: 1;
}
.markdown > br,
.markdown > p > br {
clear: both;
}
.markdown.api-container {
overflow-x: auto;
table {
min-width: 720px;
margin: 2em 0;
font-size: @font-size-base - 1px;
font-family: @code-family;
line-height: @line-height-base;
border: 1px solid @border-color-split;
th,
td {
padding: 12px;
border-color: @border-color-split;
border-width: 1px 0;
}
th {
padding-top: 14px;
border-width: 0 0 2px 0;
}
tbody tr {
transition: all 0.3s;
&:hover {
background: rgba(60, 90, 100, 0.04);
}
}
td {
&:first-child {
width: 20%;
color: @gray-8;
font-weight: 600;
}
&:nth-child(3) {
width: 22%;
color: @magenta-7;
font-size: @font-size-base - 1px;
word-break: break-all;
}
&:nth-child(4) {
width: 16%;
font-size: @font-size-base - 1px;
}
}
}
hr {
margin: 12px 0;
}
}
.grid-demo,
[id^='components-grid-demo-'] {
.demo-row,
.code-box-demo .demo-row {
margin-bottom: 8px;
overflow: hidden;
background-image: linear-gradient(
90deg,
#f5f5f5 4.16666667%,
transparent 4.16666667%,
transparent 8.33333333%,
#f5f5f5 8.33333333%,
#f5f5f5 12.5%,
transparent 12.5%,
transparent 16.66666667%,
#f5f5f5 16.66666667%,
#f5f5f5 20.83333333%,
transparent 20.83333333%,
transparent 25%,
#f5f5f5 25%,
#f5f5f5 29.16666667%,
transparent 29.16666667%,
transparent 33.33333333%,
#f5f5f5 33.33333333%,
#f5f5f5 37.5%,
transparent 37.5%,
transparent 41.66666667%,
#f5f5f5 41.66666667%,
#f5f5f5 45.83333333%,
transparent 45.83333333%,
transparent 50%,
#f5f5f5 50%,
#f5f5f5 54.16666667%,
transparent 54.16666667%,
transparent 58.33333333%,
#f5f5f5 58.33333333%,
#f5f5f5 62.5%,
transparent 62.5%,
transparent 66.66666667%,
#f5f5f5 66.66666667%,
#f5f5f5 70.83333333%,
transparent 70.83333333%,
transparent 75%,
#f5f5f5 75%,
#f5f5f5 79.16666667%,
transparent 79.16666667%,
transparent 83.33333333%,
#f5f5f5 83.33333333%,
#f5f5f5 87.5%,
transparent 87.5%,
transparent 91.66666667%,
#f5f5f5 91.66666667%,
#f5f5f5 95.83333333%,
transparent 95.83333333%
);
}
.ant-row > div,
.code-box-demo .ant-row > div {
min-height: 30px;
margin-top: 8px;
margin-bottom: 8px;
padding: 5px 0;
color: #fff;
text-align: center;
border-radius: 0;
}
.code-box-demo .ant-row > div:not(.gutter-row) {
padding: 16px 0;
background: #00a0e9;
&:nth-child(2n + 1) {
background: fade(#00a0e9, 70%);
}
}
.ant-row .demo-col,
.code-box-demo .ant-row .demo-col {
margin-top: 0;
margin-bottom: 0;
padding: 30px 0;
color: @white;
font-size: 18px;
text-align: center;
border: none;
}
.ant-row .demo-col-1 {
background: fade(#00a0e9, 70%);
}
.ant-row .demo-col-2,
.code-box-demo .ant-row .demo-col-2 {
background: fade(#00a0e9, 50%);
}
.ant-row .demo-col-3,
.code-box-demo .ant-row .demo-col-3 {
color: #999;
background: rgba(255, 255, 255, 0.2);
}
.ant-row .demo-col-4,
.code-box-demo .ant-row .demo-col-4 {
background: fade(#00a0e9, 60%);
}
.ant-row .demo-col-5,
.code-box-demo .ant-row .demo-col-5 {
color: #999;
background: rgba(255, 255, 255, 0.2);
}
.code-box-demo .height-100 {
height: 100px;
line-height: 100px;
}
.code-box-demo .height-50 {
height: 50px;
line-height: 50px;
}
.code-box-demo .height-120 {
height: 120px;
line-height: 120px;
}
.code-box-demo .height-80 {
height: 80px;
line-height: 80px;
}
}
[id='components-grid-demo-playground'],
[id='components-grid-demo-gutter'] {
> .code-box-demo .ant-row > div {
margin-top: 0;
margin-bottom: 0;
}
}
// For Changelog
.markdown ul.ant-timeline {
line-height: 2;
li.ant-timeline-item {
margin: 0;
padding: 0 0 30px;
list-style: none;
.ant-timeline-item-content {
position: relative;
top: -14px;
padding-left: 32px;
font-size: 14px;
> h2 {
margin-top: 0;
padding-top: 4px;
}
}
}
li.ant-timeline-item:first-child {
margin-top: 40px;
}
}
[data-theme='dark'] {
.markdown code {
background: fade(@white, 8%);
}
.grid-demo,
[id^='components-grid-demo-'] {
.demo-row,
.code-box-demo .demo-row {
background-image: linear-gradient(
90deg,
#1d1d1d 4.16666667%,
transparent 4.16666667%,
transparent 8.33333333%,
#1d1d1d 8.33333333%,
#1d1d1d 12.5%,
transparent 12.5%,
transparent 16.66666667%,
#1d1d1d 16.66666667%,
#1d1d1d 20.83333333%,
transparent 20.83333333%,
transparent 25%,
#1d1d1d 25%,
#1d1d1d 29.16666667%,
transparent 29.16666667%,
transparent 33.33333333%,
#1d1d1d 33.33333333%,
#1d1d1d 37.5%,
transparent 37.5%,
transparent 41.66666667%,
#1d1d1d 41.66666667%,
#1d1d1d 45.83333333%,
transparent 45.83333333%,
transparent 50%,
#1d1d1d 50%,
#1d1d1d 54.16666667%,
transparent 54.16666667%,
transparent 58.33333333%,
#1d1d1d 58.33333333%,
#1d1d1d 62.5%,
transparent 62.5%,
transparent 66.66666667%,
#1d1d1d 66.66666667%,
#1d1d1d 70.83333333%,
transparent 70.83333333%,
transparent 75%,
#1d1d1d 75%,
#1d1d1d 79.16666667%,
transparent 79.16666667%,
transparent 83.33333333%,
#1d1d1d 83.33333333%,
#1d1d1d 87.5%,
transparent 87.5%,
transparent 91.66666667%,
#1d1d1d 91.66666667%,
#1d1d1d 95.83333333%,
transparent 95.83333333%
);
}
.code-box-demo .ant-row > div:not(.gutter-row) {
padding: 16px 0;
background: #028ac8;
&:nth-child(2n + 1) {
background: fade(#0088c6, 70%);
}
}
.ant-row .demo-col,
.code-box-demo .ant-row .demo-col {
margin-top: 0;
margin-bottom: 0;
padding: 30px 0;
color: @black;
font-size: 18px;
text-align: center;
border: none;
}
.ant-row .demo-col-1 {
background: fade(#0088c6, 70%);
}
.ant-row .demo-col-3,
.code-box-demo .ant-row .demo-col-3 {
background: unset;
color: @site-text-color-secondary;
}
.ant-row .demo-col-5,
.code-box-demo .ant-row .demo-col-5 {
background: unset;
color: @site-text-color-secondary;
}
}
}