From 7c39a18231352c61a1d7fe71caff3c784863c03c Mon Sep 17 00:00:00 2001 From: zombieFox Date: Mon, 19 Aug 2019 08:24:43 +0100 Subject: [PATCH] [feature] make header shade use custom background colour --- package.json | 2 +- src/css/base.css | 4 ++-- src/css/header.css | 9 +++++++-- src/css/variables.css | 2 +- src/js/background.js | 2 +- src/js/version.js | 2 +- src/manifest.json | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b5e7a245..a32be15a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nighttab", - "version": "3.73.0", + "version": "3.74.0", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/css/base.css b/src/css/base.css index 5bc50c95..f73e63b5 100755 --- a/src/css/base.css +++ b/src/css/base.css @@ -22,11 +22,11 @@ body { } .is-background-color-by-theme body { - background-color: var(--background-color-theme); + background-color: rgb(var(--background-color-theme)); } .is-background-color-by-custom body { - background-color: var(--background-color-custom); + background-color: rgb(var(--background-color-custom)); } .is-layout-scrollpastend body { diff --git a/src/css/header.css b/src/css/header.css index b5bfaf50..bdcf392e 100755 --- a/src/css/header.css +++ b/src/css/header.css @@ -52,11 +52,16 @@ border-radius: calc(var(--theme-radius) * 4); } -.is-header-shade-style-always .header-shade, -.is-header-shade-style-scroll .header-shade { +.is-background-color-by-theme.is-header-shade-style-always .header-shade, +.is-background-color-by-theme.is-header-shade-style-scroll .header-shade { background-color: rgba(var(--header-shade-color), var(--header-shade-opacity)); } +.is-background-color-by-custom.is-header-shade-style-always .header-shade, +.is-background-color-by-custom.is-header-shade-style-scroll .header-shade { + background-color: rgba(var(--background-color-custom), var(--header-shade-opacity)); +} + .header-area { padding: calc(var(--layout-gutter) * var(--layout-padding-multiplier)); position: relative; diff --git a/src/css/variables.css b/src/css/variables.css index e8fdbc9d..89aa985d 100644 --- a/src/css/variables.css +++ b/src/css/variables.css @@ -60,7 +60,7 @@ --layout-shadow-medium: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.2); --layout-shadow-large: 0 3px 6px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.2); /* background */ - --background-color-theme: rgb(var(--theme-gray-01)); + --background-color-theme: var(--theme-gray-01); --background-color-custom: rgb(0, 0, 0); --background-image: none; --background-opacity: 1; diff --git a/src/js/background.js b/src/js/background.js index 7966434d..99f49a4e 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -71,7 +71,7 @@ var background = (function() { render.color = function() { var html = helper.e("html"); - html.style.setProperty("--background-color-custom", "rgb(" + state.get().background.color.custom.r + ", " + state.get().background.color.custom.g + ", " + state.get().background.color.custom.b + ")"); + html.style.setProperty("--background-color-custom", state.get().background.color.custom.r + ", " + state.get().background.color.custom.g + ", " + state.get().background.color.custom.b); }; render.image = function() { diff --git a/src/js/version.js b/src/js/version.js index 8c3cfee4..41dc0a4a 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,7 +1,7 @@ var version = (function() { - var current = "3.73.0"; + var current = "3.74.0"; var compare = function(a, b) { var pa = a.split("."); diff --git a/src/manifest.json b/src/manifest.json index d39ec473..037fad02 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "3.73.0", + "version": "3.74.0", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"