Skip to content

Commit

Permalink
Tag styles
Browse files Browse the repository at this point in the history
  • Loading branch information
hanju-jo committed Oct 6, 2017
1 parent ec27bdb commit dd209ba
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 18 deletions.
10 changes: 7 additions & 3 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,27 @@ $selection-background-color: $oc-gray-1;
$pagination-color: $oc-gray-6;
$pagination-over-color: $oc-gray-7;

$tag-index-label-color: $oc-white;
$tag-index-label-background-color: $oc-gray-6;
$tag-index-count-background-color: $oc-gray-7;

$footer-border-color: $oc-gray-2;
$footer-background-color: $oc-gray-1;

// List
$li-bottom-space: 0.4em;
$li-bullets-width: 1.7em;
$li-bullets-width: 1.4em;
$li-line-height: 1.55;

$ul-bullets-font: inherit;
$ul-bullets-font-size: 1.4em;
$ul-bullets-font-line-height: 1.2;
$ul-bullets-right-space: .5em;
$ul-bullets-right-space: .3em;

$ol-bullets-font: inherit;
$ol-bullets-font-size: 1em;
$ol-bullets-font-line-height: inherit;
$ol-bullets-right-space: .5em;
$ol-bullets-right-space: .3em;

$li-child-size-ratio: 0.95;

Expand Down
45 changes: 45 additions & 0 deletions style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,51 @@ nav {
}
}

// Tags
.tags > .label {
> li:before {
content: "";
}

> li {
margin: 0;
font-size: $small-font-size;
display: inline;

> a {
display: inline-block;
margin: 1px;
color: $tag-index-label-color;
background-color: $tag-index-label-background-color;
border-radius: 3px;

span {
float: left;
padding: .5px 5px;

&.count {
background-color: $tag-index-count-background-color;
border-radius: 0 3px 3px 0;
}
}
}
}
}

.tags > .tag {
a {
color: $base-color;
}
time {
color: $base-lighten-color;
font-size: $small-font-size;
font-weight: 300;
margin-left: 3px;
}
}

// Footer

.wrapper-footer {
margin-top: 50px;
border-top: 1px solid $footer-border-color;
Expand Down
27 changes: 12 additions & 15 deletions tags/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<h2>No post found</h2>
{% endif %}

<div class="tag-index">
<ul>
<div class="tags">
<ul class="label">
{% for tag in site.tags %}
<li>
<a href="#{{ tag[0] }}">
Expand All @@ -19,29 +19,26 @@ <h2>No post found</h2>
</li>
{% endfor %}
</ul>
</div>

{% for tag in site.tags %}
<article>
<div class="tag-title" id="{{ tag[0] }}">
{% for tag in site.tags %}
<h2 id="{{ tag[0] }}">
{{ tag[0] }}
</div>
<ul>
</h2>
<ul class="tag">
{% for post in tag[1] %}
{% if post.title != null %}
<li class="tag-post">
<li>
{% if post.link %}
<a href="{{ post.link }}">
<span class="tag-post-title">{{ post.title }}</span>
</a>
{% else %}
<a href="{{ site.baseurl }}{{ post.url }}">
<span class="tag-post-title">{{ post.title }}</span>
</a>
{% endif %}
{{ post.title }}
</a>
<time>{{ post.date | date: "%Y-%m-%d" }}</time>
</li>
{% endif %}
{% endfor %}
</ul>
</article>
{% endfor %}
{% endfor %}
</div>

0 comments on commit dd209ba

Please sign in to comment.