From 0dc9e52ff720b5ce82a49c024f75a678e3d832ee Mon Sep 17 00:00:00 2001 From: zzossig Date: Fri, 6 Mar 2020 10:34:35 +0900 Subject: [PATCH] [new param] viewportSize #221 widest: 1600px wider: 1440px wide: 1280px normal: 960px narrow: 800px --- README.ko.md | 4 ++++ README.md | 4 ++++ assets/sass/layout/_grid.scss | 16 ++++++++++++++++ assets/sass/main.scss | 2 ++ exampleSite/config/_default/params.toml | 1 + 5 files changed, 27 insertions(+) diff --git a/README.ko.md b/README.ko.md index ad7ee73d..8374bde8 100644 --- a/README.ko.md +++ b/README.ko.md @@ -241,6 +241,10 @@ notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed pa notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] +viewportSize = "normal" # widest, wider, wide, normal, narrow +enableUiAnimation = true +hideSingleContentsWhenJSDisabled = false + # header homeHeaderType = "text" # text, img, slide diff --git a/README.md b/README.md index d7997d14..a8adbc4e 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,10 @@ notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed pa notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] +viewportSize = "normal" # widest, wider, wide, normal, narrow +enableUiAnimation = true +hideSingleContentsWhenJSDisabled = false + # header homeHeaderType = "text" # text, img, slide diff --git a/assets/sass/layout/_grid.scss b/assets/sass/layout/_grid.scss index 57de82d1..a80e528c 100644 --- a/assets/sass/layout/_grid.scss +++ b/assets/sass/layout/_grid.scss @@ -1,3 +1,19 @@ +$grid_max_width: 960; + +@if global-variable-exists(viewport_size) { + @if $viewport_size == widest { + $grid_max_width: 1600; + } @else if $viewport_size == wider { + $grid_max_width: 1440; + } @else if $viewport_size == wide { + $grid_max_width: 1280; + } @else if $viewport_size == narrow { + $grid_max_width: 800; + } @else { + $grid_max_width: 960; + } +} + $grid_max: $grid_max_width + $grid_max_unit; $grid_main_main: $grid_main_main_width + $grid_main_main_unit; $grid_main_side: $grid_main_side_width + $grid_main_side_unit; diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 3ae5d914..462adf0f 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -31,6 +31,8 @@ $title-font: {{ .Site.Data.font.title_font }}; $content-font: {{ .Site.Data.font.content_font }}; $cursive-font: {{ .Site.Data.font.cursive_font }}; +$viewport_size: {{ .Site.Params.viewportSize | default "normal" }}; + @import 'abstracts/variables'; @import 'abstracts/mixins'; @import 'abstracts/functions'; diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index b18076c5..12f2aae1 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -13,6 +13,7 @@ notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", " notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"] notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] +viewportSize = "normal" # widest, wider, wide, normal, narrow enableUiAnimation = true hideSingleContentsWhenJSDisabled = false