Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize font in sass #115

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
name: Install hugo
command: |
apk add wget
wget -q https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-64bit.tar.gz
wget -q https://github.com/gohugoio/hugo/releases/download/v0.63.2/hugo_extended_0.63.2_Linux-64bit.tar.gz
apk add tar
tar xzf hugo_0.58.3_Linux-64bit.tar.gz
tar xzf hugo_extended_0.63.2_Linux-64bit.tar.gz
chmod a+x hugo
mv hugo /usr/local/bin/hugo

- run:
name: Create site
command: hugo new site my-site
command: /usr/local/bin/hugo new site my-site

- run:
name: Clone the theme from the PR
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- run:
name: Create hugo site
working_directory: my-site
command: hugo
command: /usr/local/bin/hugo

- run:
name: Create now.json
Expand Down
4 changes: 2 additions & 2 deletions assets/fresh/partials/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classes to change the feel of bulma buttons
cursor: pointer;
transition: all 0.5s;
&.cta {
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;
font-size: 1rem;
font-weight: 600;
padding: 26px 40px 26px 40px;
Expand All @@ -29,7 +29,7 @@ Classes to change the feel of bulma buttons
&.signup-button {
font-size: .9rem;
font-weight: 600;
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;
padding: 24px 26px;
width: 130px;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/fresh/partials/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cards and Card content styles
border-radius: 3px;
margin: 0 auto;
.card-title h4 {
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;
padding-top: 25px;
font-size: 1.2rem;
font-weight: 600;
Expand Down
2 changes: 1 addition & 1 deletion assets/fresh/partials/_hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Hero styles
padding-top: 6rem;
padding-bottom: 6rem;
.title, .subtitle {
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;
}
.title {
&.is-bold {
Expand Down
4 changes: 2 additions & 2 deletions assets/fresh/partials/_sections.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Section Styles
height: 75vh !important;
}
.title, .subtitle {
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;

}
.subtitle {
Expand All @@ -32,7 +32,7 @@ Section Styles
max-width: 500px;
margin: 0 auto;
.title, .subtitle {
font-family: 'Open Sans', sans-serif;
font-family: $font-stack;

}
.subtitle {
Expand Down
2 changes: 1 addition & 1 deletion assets/fresh/partials/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Sidebar Styles
max-width: 400px;
list-style: none;
list-style-type: none;
font-family: 'Open Sans', sans-serif !important;
font-family: $font-stack !important;
li {
a {
padding: 20px 25px;
Expand Down
6 changes: 6 additions & 0 deletions assets/style.sass
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
// ==========================================================================
// Parameterized variables
// ==========================================================================

$font-stack: '{{ .Site.Params.font.name | default "Open Sans" }}', sans-serif

@import "bulma/bulma"
@import "fresh/core"
5 changes: 3 additions & 2 deletions layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- $inServerMode := .Site.IsServer }}
{{- $sass := "style.sass" }}
{{- $sassTemplate := "style.$sass" }}
{{- $cssTarget := "css/style.css" }}
{{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }}
{{- $fontName := .Site.Params.font.name | default "Open Sans" }}
Expand All @@ -9,10 +10,10 @@
<link rel="icon" type="image/png" href="{{ "images/favicon.png" | relURL }}" />
<link href="{{ $fontUrl }}" rel="stylesheet">
{{- if $inServerMode }}
{{- $css := resources.Get $sass | toCSS $cssOpts }}
{{- $css := resources.Get $sass | resources.ExecuteAsTemplate $sassTemplate . | toCSS $cssOpts }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}">
{{- else }}
{{- $css := resources.Get $sass | toCSS $cssOpts | minify | fingerprint }}
{{- $css := resources.Get $sass | resources.ExecuteAsTemplate $sassTemplate . | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{- end }}
<link rel="stylesheet" type="text/css" href="{{ "css/icons.css" | relURL }}">