Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
chore(style): update css code style
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Feb 20, 2020
1 parent 315eb09 commit 41a14bc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 38 deletions.
11 changes: 11 additions & 0 deletions assets/css/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ $header-height-mobile: 4rem !default;
$header-background-color: #f8f8f8 !default;
$header-background-color-dark: #252627 !default;

// Position of the header
$header-position-desktop: if($header-normal-mode-desktop, static, fixed) !default;
$header-position-mobile: if($header-normal-mode-mobile, static, fixed) !default;

// Top of the page padding
$page-padding-top-desktop: if($header-normal-mode-desktop, 1rem, 6rem) !default;
$page-padding-top-mobile: if($header-normal-mode-mobile, 1rem, 6rem) !default;

// Top of the post toc
$post-toc-top: if($header-normal-mode-desktop, 7rem, 12rem) !default;

// Color of the hover header item
$header-hover-color: #161209 !default;
$header-hover-color-dark: #fff !default;
Expand Down
28 changes: 6 additions & 22 deletions assets/css/style.template.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
@charset 'utf-8';

$home-profile: {{- if .Site.Params.home.profile.enable -}}true{{ else }}false{{ end }};
$home-posts: {{- if .Site.Params.home.posts.enable -}}true{{ else }}false{{ end }};

{{- if eq .Site.Params.header.desktopMode "normal" -}}
$header-position-desktop: static;
$page-padding-top-desktop: 1rem;
$post-toc-top: 7rem;
{{- else -}}
$header-position-desktop: fixed;
$page-padding-top-desktop: 6rem;
$post-toc-top: 12rem;
{{- end -}}

{{- if eq .Site.Params.header.mobileMode "normal" -}}
$header-position-mobile: static;
$page-padding-top-mobile: 1rem;
{{- else -}}
$header-position-mobile: fixed;
$page-padding-top-mobile: 6rem;
{{- end -}}
$home-profile: {{ if .Site.Params.home.profile.enable }}true{{ else }}false{{ end }};
$home-posts: {{ if .Site.Params.home.posts.enable }}true{{ else }}false{{ end }};
$header-normal-mode-desktop: {{ if eq .Site.Params.header.desktopMode "normal" }}true{{ else }}false{{ end }};
$header-normal-mode-mobile: {{ if eq .Site.Params.header.mobileMode "normal" }}true{{ else }}false{{ end }};

@import "_variables";

{{- if fileExists "config/css/_custom.scss" -}}
@import "_custom";
{{- if fileExists "config/css/_override.scss" -}}
@import "_override";
{{- end -}}

@import "_core/normalize";
Expand Down
11 changes: 0 additions & 11 deletions exampleSite/config/css/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,3 @@
// Custom style
// 自定义样式
// ==============================
// You can override the variables in assets/css/_variables.scss to customize the style
// 您可以覆盖 assets/css/_variables.scss 中的变量以自定义样式

@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900);

$global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft Yahei, Segoe UI, Helvetica, Arial, sans-serif, Segoe UI Emoji;


@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,700&display=swap&subset=latin-ext');

$code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospace;
15 changes: 15 additions & 0 deletions exampleSite/config/css/_override.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// ==============================
// Override Variables
// 覆盖变量
// ==============================
// You can override the variables in assets/css/_variables.scss to customize the style
// 您可以覆盖 assets/css/_variables.scss 中的变量

@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900);

$global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft Yahei, Segoe UI, Helvetica, Arial, sans-serif, Segoe UI Emoji;


@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,700&display=swap&subset=latin-ext');

$code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospace;
8 changes: 4 additions & 4 deletions layouts/partials/head/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

{{- /* style.min.css */ -}}
{{- $res := resources.Get "css/style.template.scss" -}}
{{- $options := dict "targetPath" "css/style.min.css" "outputStyle" "compressed" "enableSourceMap" true -}}
{{- if fileExists "config/css/_custom.scss" -}}
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
{{- end -}}
{{- $options := dict "targetPath" "css/style.min.css" -}}
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
{{- $options = dict "outputStyle" "compressed" | merge $options -}}
{{- $options = dict "enableSourceMap" true | merge $options -}}
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">

Expand Down

Large diffs are not rendered by default.

0 comments on commit 41a14bc

Please sign in to comment.