fix(link): fix long words and URLs style bug

This commit is contained in:
Dillon
2020-02-13 13:30:58 +08:00
parent a07f0c65f5
commit 917cf4a427
11 changed files with 397 additions and 384 deletions

View File

@@ -30,6 +30,7 @@ body {
line-height: 1.5rem; line-height: 1.5rem;
background-color: $global-background-color; background-color: $global-background-color;
color: $global-font-color; color: $global-font-color;
overflow-wrap: break-word;
&::before { &::before {
content: ""; content: "";
@@ -59,6 +60,7 @@ body {
a { a {
color: $global-link-color; color: $global-link-color;
text-decoration: none; text-decoration: none;
word-break: break-all;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
&:hover { &:hover {

View File

@@ -1,17 +1,17 @@
@import "_home";
@import "_404";
.page { .page {
position: relative; position: relative;
width: 100%; width: 100%;
max-width: 980px; max-width: 980px;
margin: 0 auto; margin: 0 auto;
padding-top: 6rem; padding-top: 6rem;
@import "_post";
@import "_posts";
} }
@import "_home";
@import "_404";
@import "_post";
@import "_posts";
.archive { .archive {
.post-title { .post-title {
text-align: right; text-align: right;

View File

@@ -1,11 +1,12 @@
/** Post **/ /** Post **/
.post-title { .post {
margin: 0 !important; .post-title {
margin: 0;
font-size: 1.8rem; font-size: 1.8rem;
line-height: 3rem; line-height: 3rem;
} }
.post-meta { .post-meta {
font-size: .88rem; font-size: .88rem;
color: $global-font-secondary-color; color: $global-font-secondary-color;
@@ -36,9 +37,9 @@
.author { .author {
font-size: 1.05rem; font-size: 1.05rem;
} }
} }
.post-featured-image { .post-featured-image {
padding-top: .6rem; padding-top: .6rem;
img { img {
@@ -48,11 +49,11 @@
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
} }
} }
@import "../_partial/_post/toc"; @import "../_partial/_post/toc";
.post-content { .post-content {
.post-dummy-target:target { .post-dummy-target:target {
display: inline-block; display: inline-block;
position: relative; position: relative;
@@ -369,8 +370,8 @@
.float-right { .float-right {
float: right; float: right;
} }
}
@import "../_partial/_post/footer";
@import "../_partial/_post/comment";
} }
@import "../_partial/_post/footer";
@import "../_partial/_post/comment";

View File

@@ -9,7 +9,7 @@
} }
} }
.post { .summary {
padding-top: 1rem; padding-top: 1rem;
padding-bottom: .8rem; padding-bottom: .8rem;
color: $global-font-color; color: $global-font-color;
@@ -36,7 +36,7 @@
} }
} }
.post-list-title { .post-title {
font-size: 1.6rem; font-size: 1.6rem;
} }
@@ -60,14 +60,19 @@
} }
.post-content { .post-content {
display: -moz-box;
display: -webkit-box; display: -webkit-box;
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
margin-top: .3rem; margin-top: .3rem;
width: 100%; width: 100%;
max-height: 10rem; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
-webkit-box-orient: vertical; overflow-wrap: break-word;
-webkit-line-clamp: 2; }
h1,
h2, h2,
h3, h3,
h4, h4,
@@ -75,16 +80,21 @@
h6, h6,
p { p {
font-size: 1rem; font-size: 1rem;
margin: 0; display: inline;
padding: .2rem 0;
overflow: hidden; &::after {
overflow-wrap: break-word; content: "\A";
text-overflow: ellipsis; white-space: pre;
}
} }
a { h1,
word-break: break-all; h2,
} h3,
h4,
h5,
h6 {
line-height: 2;
} }
.post-footer { .post-footer {

View File

@@ -5,7 +5,7 @@
display: inline-block; display: inline-block;
position: relative; position: relative;
margin: 5px 10px; margin: 5px 10px;
word-wrap: break-word; overflow-wrap: break-word;
transition-duration: .3s; transition-duration: .3s;
transition-property: transform; transition-property: transform;
transition-timing-function: ease-out; transition-timing-function: ease-out;

View File

@@ -5,7 +5,7 @@
margin-left: 1000px; margin-left: 1000px;
padding: 0 .8rem; padding: 0 .8rem;
border-left: 1px solid $global-border-color; border-left: 1px solid $global-border-color;
word-wrap: break-word; overflow-wrap: break-word;
box-sizing: border-box; box-sizing: border-box;
top: 12rem; top: 12rem;

View File

@@ -1,4 +1,4 @@
<article class="post" itemscope itemtype="http://schema.org/Article"> <article class="post summary" itemscope itemtype="http://schema.org/Article">
{{- /* Featured image */ -}} {{- /* Featured image */ -}}
{{- with .Params.featured_image -}} {{- with .Params.featured_image -}}
<div class="post-featured-image-preview"> <div class="post-featured-image-preview">
@@ -8,7 +8,7 @@
{{- end -}} {{- end -}}
{{- /* Title */ -}} {{- /* Title */ -}}
<h1 class="post-title post-list-title" itemprop="name headline"> <h1 class="post-title" itemprop="name headline">
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .Permalink }}">{{ .Title }}</a>
</h1> </h1>

View File

@@ -1,7 +1,7 @@
{{- define "content" -}} {{- define "content" -}}
{{- /* Home mode [post] */ -}} {{- /* Home mode [post] */ -}}
{{- if eq .Site.Params.home_mode "post" -}} {{- if eq .Site.Params.home_mode "post" -}}
<div class="page"> <div class="page home">
{{- /* Profile */ -}} {{- /* Profile */ -}}
{{- partial "home/profile.html" . -}} {{- partial "home/profile.html" . -}}

View File

@@ -1,7 +1,7 @@
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}} {{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
{{- define "content" -}} {{- define "content" -}}
<article class="page"> <article class="page post">
{{- /* Title */ -}} {{- /* Title */ -}}
<h1 class="post-title animated flipInX">{{ .Title }}</h1> <h1 class="post-title animated flipInX">{{ .Title }}</h1>

File diff suppressed because one or more lines are too long