feat(shortcode): add link shortcode (#179)

* feat(shortcode): add link shortcode

* docs: add docs for link shortcode

* docs: fix 'mailto' in link shortcode docs error
This commit is contained in:
Dillon
2020-03-17 21:16:04 +08:00
committed by GitHub
parent f9dba2e36c
commit 6b03c711ac
30 changed files with 375 additions and 252 deletions

View File

@@ -1,6 +1,8 @@
.tag-cloud-tags {
margin: 10px 0;
@include link(true, true);
a {
display: inline-block;
position: relative;
@@ -14,23 +16,18 @@
&:active,
&:focus,
&:hover {
color: $global-link-hover-color;
-webkit-transform: scale(1.2);
-moz-transform: scale(1.2);
-ms-transform: scale(1.2);
-o-transform: scale(1.2);
transform: scale(1.2);
.dark-theme & {
color: $global-link-hover-color-dark;
}
}
small {
color: $global-font-secondary-color;
.dark-theme & {
color: $global-link-hover-color-dark;
color: $global-font-secondary-color-dark;
}
}
}

View File

@@ -1,160 +0,0 @@
@mixin summary {
.summary {
padding-top: 1rem;
padding-bottom: .8rem;
color: $global-font-color;
border-bottom: 1px dashed $global-border-color;
.dark-theme & {
color: $global-font-color-dark;
border-bottom: 1px dashed $global-border-color-dark;
}
.featured-image-preview {
width: 100%;
padding: 30% 0 0;
position: relative;
margin: 0.6rem auto;
img {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
object-fit: cover;
}
}
.single-title {
font-size: 1.4rem;
line-height: 140%;
margin: 0.4rem 0;
}
.content {
display: -moz-box;
display: -webkit-box;
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
margin-top: .3rem;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
color: $global-font-secondary-color;
.dark-theme & {
color: $global-font-secondary-color-dark;
}
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
display: inline;
&::after {
content: "\A";
white-space: pre;
}
}
h2,
h3,
h4,
h5,
h6 {
line-height: 2;
&::before {
content: "|";
margin-right: .3125rem;
color: $global-link-color;
.dark-theme & {
color: $global-link-color-dark;
}
}
}
h2 {
font-size: 1.2rem;
&::before {
content: "#";
}
}
a {
color: $global-link-color;
.dark-theme & {
color: $global-link-color-dark;
}
&:hover {
color: $global-link-hover-color;
.dark-theme & {
color: $global-link-hover-color-dark;
}
}
}
b, strong {
.dark-theme & {
color: $global-font-secondary-color-dark;
}
}
}
.post-footer {
margin-top: .4rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: .875rem;
a {
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
&:hover {
color: $single-link-hover-color;
.dark-theme & {
color: $single-link-hover-color-dark;
}
}
}
.post-tags {
padding: 0;
a {
color: $global-link-color;
.dark-theme & {
color: $global-link-color-dark;
}
&:hover {
color: $global-link-hover-color;
.dark-theme & {
color: $global-link-hover-color-dark;
}
}
}
}
}
}
}

View File

@@ -46,23 +46,12 @@ code, pre, .highlight table, .highlight tr, .highlight td {
}
}
.ln {
padding-right: .8rem;
}
.lntd {
&:first-child {
width: 1.2rem;
/* LineNumbersTable */
.lnt {
color: $code-info-color;
}
/* LineHighlight */
.hl {
font-weight: bolder;
}
}
&:last-child {
/* LineHighlight */
.hl {
display: block;
background-color: darken($code-background-color, 5%);
@@ -73,6 +62,14 @@ code, pre, .highlight table, .highlight tr, .highlight td {
}
}
}
.ln, .lnt {
color: $global-font-secondary-color;
.dark-theme & {
color: $global-font-secondary-color-dark;
}
}
}
.highlight {
@@ -103,6 +100,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
table, tr, td {
margin: 0;
border: none !important;
white-space: nowrap;
}
td {
@@ -119,21 +117,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
padding: .4rem .8rem;
background-color: darken($code-background-color, 5%);
a {
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
}
a:hover {
color: $single-link-hover-color;
.dark-theme &:hover {
color: $single-link-hover-color-dark;
}
}
@include link(false, false);
.dark-theme & {
background-color: darken($code-background-color-dark, 5%);

View File

@@ -21,21 +21,7 @@
color: $global-font-secondary-color-dark;
}
a {
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
&:hover {
color: $single-link-hover-color;
.dark-theme & {
color: $single-link-hover-color-dark;
}
}
}
@include link(false, false);
}
.post-info-license {
@@ -51,21 +37,7 @@
font-size: 0.8rem;
width: 8rem;
a {
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
&:hover {
color: $single-link-hover-color;
.dark-theme & {
color: $single-link-hover-color-dark;
}
}
}
@include link(false, false);
}
}
}