Skip to content

Commit

Permalink
Merge pull request #33 from kentnek/kent-scss
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewies authored Jun 22, 2020
2 parents f7fa4e6 + bef5fd4 commit ee446ad
Show file tree
Hide file tree
Showing 51 changed files with 942 additions and 4,905 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ Thumbs.db

# IDEs
.vscode

# Hugo
**/resources/_gen
public/
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ A minimal blog theme built for [Hugo](https://gohugo.io/) 🍜

- An about page 👋🏻 and a blog 📝
- Blog posts can be tagged 🏷
- Mathematical notations are supported with KaTex
- Sass/SCSS for styling

### Prerequisites

Hugo extended version (for Sass/SCSS support).

### Getting started

Expand Down Expand Up @@ -93,6 +99,33 @@ In your site's `config.toml`, add a new menu definition for say, "photos":

Then, put your posts under "content/photos".

### Custom styling

In your site's folder, create `assets/scss/custom.scss` and put your custom styling there. For example, the snippet below
changes the dot's color on your About page to blue:

```scss
// custom.scss
.fancy {
color: #1e88e5;
}
```

You can even use Hugo variables/params in your custom styles too!

```scss
// custom.scss
.fancy {
color: {{ .Site.Params.colors.fancy | default "#1e88e5" }}
}
```

```toml
# config.toml
[params.colors]
fancy = "#f06292"
```

### Tags

Right now `hugo-theme-codex` uses the `tags` taxonomy for blog posts. You can view all the blog posts of a given tag by going to `/tags/:tag-name`, where `:tag-name` is the name of your tag.
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions assets/scss/_main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@import 'partials/normalize';
@import 'partials/vars';
@import 'partials/reset';
@import 'partials/typography';
@import 'partials/nav';
@import 'partials/social-icons';

body.nav--active {
overflow: hidden;
}

main {
padding: 3rem 1.5rem;


@media screen and (min-width: $medium) {
padding-left: calc(1.5rem + #{$navWidth});
}

@media screen and (max-width: $medium - 1) {
padding-top: calc(3rem + #{$burgerContainerHeight});
}
}
Empty file added assets/scss/custom.scss
Empty file.
59 changes: 59 additions & 0 deletions assets/scss/pages/about.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@import '../main';

.splash-container {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;

@media screen and (min-width: $medium) {
font-size: 18px;
}
}

.splash {
h1 {
font-size: 3em;
line-height: 1;
letter-spacing: -0.03em;
margin: 0;
}

h2 {
font-size: 2.25em;
font-weight: 500;
line-height: 1.25;
max-width: 22em;
letter-spacing: -0.03em;
}
}

.fancy {
color: $primary;
}

.handle {
display: inline-block;
margin-top: 0.275em;
color: $grey;
letter-spacing: 0.5px;
}

.writing {
text-decoration: none;
color: $primary;
}

/* overrides */

main {
padding-top: 0;
padding-bottom: 0;
height: 100%;
}

.social-icons {
justify-content: flex-start;
padding-top: 2rem;
}
238 changes: 238 additions & 0 deletions assets/scss/pages/post.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
@import '../main';
@import '../partials/github-syntax-highlighting';

.post {
width: 100%;
max-width: 34rem;
margin: 0 auto;

h2, h3 {
position: relative;
padding-top: 10px;

.anchor {
text-decoration: none;
position: absolute;
left: -1rem;
color: $grey;
font-size: 1.2rem;
font-weight: 400;
}

.anchor:hover {
color: $darkGrey;
}
}

blockquote {
width: 95%;
margin: 0 auto;
font-size: 1rem;

a {
color: $darkGrey;
text-decoration: underline;
}
}

img {
width: 100%;
max-width: 500px;
margin: 0 auto;
display: block;
}
}

.post__content a {
font-weight: 400;
color: #0366d6;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}

.post__title {
margin-top: 0;
margin-bottom: 0.5rem;
}

.post__date {
color: $grey;
font-size: 0.8rem;
}

.cp_embed_wrapper {
margin-top: 1.5rem;
}

.codepen__caption {
display: block;
width: 75%;
margin: 0.5rem auto 0;
color: $grey;
font-size: 0.8rem;
font-weight: 300;
text-align: center;
}

.note {
width: 90%;
margin: 1rem auto 0;
font-size: 12px;
text-align: center;
line-height: 1.5;
color: $grey;

code {
font-size: 12px;
color: $darkGrey;
background-color: transparent;

&:before,
&:after {
content: '`';
}
}

a {
color: $darkGrey;
text-decoration: underline;
}
}

.tags__list {
padding-right: 1.5rem;
margin: 1.5rem 0 0;
list-style: none;
display: flex;
justify-content: flex-end;
}

.tag__item {
margin-right: 1rem;
display: inline-block;

&:last-child {
margin-right: 0;
}
}

.tag__link {
display: inline-block;
text-decoration: none;
padding: 0.2em 0.4em;
border-radius: 3px;
background: lighten($primary, 41%);
color: $primary;
font-size: 0.8rem;

&:hover {
background: lighten($primary, 38%);
}
}

.gif {
margin-top: 1.5rem;

img {
max-width: 375px;
}
}

p.warning {
background: #FFF9DF;
padding: 1rem;
font-size: 0.8rem;
line-height: 1.5;
color: #747160;
border-left: 2px solid #747160;

a {
color: #747160;
text-decoration: underline;
}
}

.pagination {
display: flex;
flex-direction: column;
margin-top: 1.5rem;

@media screen and (min-width: 600px) {
flex-direction: row;
justify-content: space-between;
}
}

.pagination__item {
text-decoration: none;
display: flex;
flex-direction: column;

&:nth-child(2) {
margin-top: 1.5rem;
}

@media screen and (min-width: 600px) {
width: 275px;
padding: 15px;
border-radius: 4px;
&:first-of-type {
padding-right: 15px;
}
&:last-of-type {
margin-top: 0;
}
&:hover {
background-color: #f6f9fc;
}
}
}

.pagination__label {
color: $grey;
font-size: 0.8rem;
}

.pagination__title {
color: $black;
font-weight: 700;
margin-top: 0.25rem;
}

footer {
text-align: center;
padding: 0 1.5rem;
background: #ffffff;

p {
color: $grey;
font-size: 0.65rem;
}
}


/* overrides */
.post__content {
ul {
list-style: none;

li {
margin-bottom: 0.5rem;

&::before {
content: '-';
color: $darkGrey;
position: absolute;
margin-left: -15px;
}
}
}
}

.twitter-tweet.twitter-tweet-rendered {
margin: 1.5rem auto !important;
width: 375px !important;
}
Loading

0 comments on commit ee446ad

Please sign in to comment.