Skip to content

Commit

Permalink
refactor: update theme notes
Browse files Browse the repository at this point in the history
  • Loading branch information
EryouHao committed Jul 14, 2019
1 parent c57b9df commit e4c8da1
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
display: block;
.post-title {
font-size: 16px;
font-weight: bold;
font-weight: 900;
letter-spacing: .02em;
}
.time {
font-size: 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@
font-size: 28px;
text-align: center;
padding: 24px 0;
font-weight: 600;
font-weight: 900;
letter-spacing: .02em;
}

.post-info {
text-align: center;
font-size: 12px;
padding-bottom: 24px;
.post-time {
> span {
color: @dark-gray;

&:not(:first-child) {
&:before {
content: "/ ";
font-size: 10px;
color: rgba(0,0,0,.1);
margin: 0 4px;
}
}
}
.post-tag {
padding: 8px 8px;
Expand Down
103 changes: 77 additions & 26 deletions public/default-files/themes/notes/assets/styles/components/post.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,26 @@
font-size: 32px;
text-align: center;
padding: 24px 0;
font-weight: 600;
font-weight: 900;
letter-spacing: 0.02em;
}

.post-info {
text-align: center;
font-size: 12px;
padding-bottom: 24px;

.post-time {
> span {
color: @dark-gray;

&:not(:first-child) {
&:before {
content: "/ ";
font-size: 10px;
color: rgba(0,0,0,.1);
margin: 0 4px;
}
}
}

.post-tag {
Expand All @@ -37,13 +47,16 @@
.post-content {
width: 100%;
flex-shrink: 0;
font-family: "Droid Serif","PingFang SC","Hiragino Sans GB","Droid Sans Fallback","Microsoft YaHei",sans-serif;

a {
color: @main-color;
transition: all 0.3s;
color: rgba(0,0,0,.98);
word-wrap: break-word;
text-decoration: none;
border-bottom: 1px solid rgba(0,0,0,.26);
&:hover {
color: @dark-main-color;
border-bottom: 1px dotted @dark-main-color;
border-bottom: 1px solid @dark-main-color;
}
}
img {
Expand All @@ -55,10 +68,11 @@
}

p {
line-height: 1.725;
margin-bottom: 24px;
line-height: 1.62;
margin-bottom: 1.12em;
font-size: 16px;
letter-spacing: .05em;
hyphens: auto;
}

p, li {
Expand All @@ -82,20 +96,27 @@
padding: 0;
position: relative;
code {
white-space: pre;
font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, 'Courier New',monospace;
line-height: 1.75;
padding: 1em 1.5em;
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: auto;
font-size: 0.86rem;
font-family: 'Source Code Pro', Consolas, Menlo, Monaco, 'Courier New', monospace;
padding: 1em;
border-radius: 5px;
line-height: 1.5;
}
}

blockquote {
font-style: italic;
border-left: 2px solid #ccc;
margin-left: 0;
padding-left: 1.8em;
color: #9a9a9a;
position: relative;
padding: .4em 0 0 2.2em;
font-size: .96em;
&:before {
position: absolute;
top: -4px;
left: 0;
content: "\201c";
font: 700 62px/1 serif;
color: rgba(0,0,0,.1);
}
}

table {
Expand All @@ -118,32 +139,61 @@
margin-bottom: 16px;
}

ul {
list-style-type: square;
}

h1, h2, h3, h4, h5, h6 {
margin: 16px 0;
font-weight: bold;
font-weight: 700;
padding-top: 16px;
}
h1 {
font-size: 28px;
font-size: 1.8em;
}
h2 {
font-size: 24px;
font-size: 1.42em;
}
h3 {
font-size: 20px;
font-size: 1.17em;
}
h4 {
font-size: 18px;
font-size: 1em;
}
h5 {
font-size: 16px;
font-size: 1em;
}
h6 {
font-size: 14px;
font-size: 1em;
font-weight: 500;
}
hr {
border-top: 1px solid #fafafa;
margin: 16px 0;
display: block;
border: 0;
margin: 2.24em auto 2.86em;
&:before {
color: rgba(0,0,0,.2);
font-size: 1.1em;
display: block;
content: "* * *";
text-align: center;
}
}

.footnotes {
margin-left: auto;
margin-right: auto;
max-width: 760px;
padding-left: 18px;
padding-right: 18px;
&:before {
content: "";
display: block;
border-top: 4px solid rgba(0,0,0,.1);
width: 50%;
max-width: 100px;
margin: 40px 0 20px;
}
}

.contains-task-list {
Expand Down Expand Up @@ -222,6 +272,7 @@
.post-title {
font-size: 20px;
font-weight: bold;
letter-spacing: .02em;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ body {
/* Grouping content
========================================================================== */

/**
* Add the correct height in Firefox.
*/

hr {
height: 0;
}

/* Text-level semantics
========================================================================== */
Expand Down
10 changes: 4 additions & 6 deletions public/default-files/themes/notes/assets/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ html {
font-size: 58%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, opensans, Optima, 'Microsoft Yahei', sans-serif;
font-size: 16px;
color: #333;
// background: #f3f7f9;
color: rgba(0,0,0,.86);
font: 400 16px/1.42 -apple-system,BlinkMacSystemFont,"Helvetica Neue","PingFang SC","Hiragino Sans GB","Droid Sans Fallback","Microsoft YaHei",sans-serif;
letter-spacing: .05em;
}
a {
color: #333;
color: rgba(0,0,0,.98);
text-decoration: none;
transition: all 0.3s;
&:hover {
color: @main-color;
}
}
body, div, a, p, ul, li, ol, h1, h2, h3, h4, h5, h6, table, tr, td {
font-weight: normal;
box-sizing: border-box;
margin: 0;
padding: 0;
Expand All @@ -47,6 +44,7 @@ body, div, a, p, ul, li, ol, h1, h2, h3, h4, h5, h6, table, tr, td {
display: flex;
min-height: 100vh;
flex-direction: column;
padding: 0 24px;
}
}

Expand Down
12 changes: 6 additions & 6 deletions public/default-files/themes/notes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Notes",
"version": "1.1.0",
"author": "EryouHao",
"repository": "https://github.com/getgridea/gridea-theme-paper",
"repository": "https://github.com/getgridea/gridea-theme-notes",
"customConfig": [
{
"name": "contentMaxWidth",
Expand Down Expand Up @@ -46,12 +46,12 @@
"name": "siteFont",
"label": "网站字体",
"group": "布局",
"value": "-apple-system, BlinkMacSystemFont, opensans, Optima, 'Microsoft Yahei', sans-serif",
"value": "-apple-system,BlinkMacSystemFont,'Helvetica Neue','PingFang SC','Hiragino Sans GB','Droid Sans Fallback','Microsoft YaHei',sans-serif",
"type": "select",
"options": [
{
"label": "-apple-system, BlinkMacSystemFont, opensans, Optima, 'Microsoft Yahei', sans-serif",
"value": "-apple-system, BlinkMacSystemFont, opensans, Optima, 'Microsoft Yahei', sans-serif"
"label": "-apple-system,BlinkMacSystemFont,'Helvetica Neue','PingFang SC','Hiragino Sans GB','Droid Sans Fallback','Microsoft YaHei',sans-serif",
"value": "-apple-system,BlinkMacSystemFont,'Helvetica Neue','PingFang SC','Hiragino Sans GB','Droid Sans Fallback','Microsoft YaHei',sans-serif"
},
{
"label": "Georgia, serif",
Expand Down Expand Up @@ -90,7 +90,7 @@
"name": "textColor",
"label": "文字颜色",
"group": "颜色",
"value": "#333333",
"value": "rgba(0, 0, 0, 0.86)",
"type": "input",
"card": "color",
"note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))"
Expand All @@ -99,7 +99,7 @@
"name": "linkColor",
"label": "链接颜色",
"group": "颜色",
"value": "#333333",
"value": "rgba(0,0,0,.98)",
"type": "input",
"card": "color",
"note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))"
Expand Down
4 changes: 2 additions & 2 deletions public/default-files/themes/notes/style-override.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const generateOverride = (params = {}) => {
}

// 文字颜色 - textColor
if (params.textColor && params.textColor !== '#333333') {
if (params.textColor && params.textColor !== 'rgba(0, 0, 0, 0.86)') {
result += `
body {
color: ${params.textColor};
Expand All @@ -83,7 +83,7 @@ const generateOverride = (params = {}) => {
}

// 链接颜色 - linkColor
if (params.linkColor && params.linkColor !== '#333333') {
if (params.linkColor && params.linkColor !== 'rgba(0,0,0,.98)') {
result += `
a {
color: ${params.linkColor};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" href="<%= themeConfig.domain %>/styles/main.css">

<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.23.0/moment.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700">

<% if (site.customConfig.ga) { %>
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= site.customConfig.ga %>"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
<h2 class="post-title"><%= post.title %></h2>
</a>
<div class="post-info">
<time class="post-time">
· <%= post.dateFormat %> ·
</time>
<span>
<%= post.dateFormat %>
</span>
<span>
<%= post.stats.text %>
</span>
<% post.tags.forEach(function(tag) { %>
<a href="<%= tag.link %>" class="post-tag">
# <%= tag.name %>
Expand Down
9 changes: 6 additions & 3 deletions public/default-files/themes/notes/templates/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
<%= post.title %>
</h2>
<div class="post-info">
<time class="post-time">
· <%= post.dateFormat %> ·
</time>
<span>
<%= post.dateFormat %>
</span>
<span>
<%= post.stats.text %>
</span>
<% post.tags.forEach(function(tag) { %>
<a href="<%= tag.link %>" class="post-tag">
# <%= tag.name %>
Expand Down
2 changes: 1 addition & 1 deletion public/default-files/themes/notes/templates/tag.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%- include('./includes/header') %>
<div class="current-tag-container">
<h2 class="title">
标签:#<%= tag.name %>
标签:# <%= tag.name %>
</h2>
</div>
<%- include('./includes/post-list') %>
Expand Down

0 comments on commit e4c8da1

Please sign in to comment.