Skip to content

Commit ca93924

Browse files
committed
[refactor] improve overscroll background colour
1 parent bf58d25 commit ca93924

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nighttab",
3-
"version": "3.76.0",
3+
"version": "3.77.0",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
55
"main": "index.js",
66
"scripts":{

‎src/css/base.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ body{
2121
/* transition: background-color var(--layout-timing-extra-fast); */
2222
}
2323

24+
html.is-background-color-by-theme,
2425
.is-background-color-by-themebody{
2526
background-color:rgb(var(--background-color-theme));
2627
}
2728

29+
html.is-background-color-by-custom,
2830
.is-background-color-by-custombody{
2931
background-color:rgb(var(--background-color-custom));
3032
}

‎src/css/variables.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
--link-item-display-icon-size:2.5em;
4747
--link-item-name-size:0.9em;
4848
/* layout */
49-
--layout-line-width:0.2em;
49+
--layout-line-width:0.2rem;
5050
--layout-gutter:0.5rem;
5151
--layout-width:80%;
5252
--layout-padding-multiplier:4;

‎src/js/background.js‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ var background = (function(){
6969

7070
varrender={};
7171

72-
render.color=function(){
73-
varhtml=helper.e("html");
74-
html.style.backgroundColor="rgb("+state.get().background.color.custom.r+", "+state.get().background.color.custom.g+", "+state.get().background.color.custom.b+")";
75-
html.style.setProperty("--background-color-custom",state.get().background.color.custom.r+", "+state.get().background.color.custom.g+", "+state.get().background.color.custom.b);
72+
render.color={
73+
custom: function(){
74+
helper.e("html").style.setProperty("--background-color-custom",state.get().background.color.custom.r+", "+state.get().background.color.custom.g+", "+state.get().background.color.custom.b);
75+
},
76+
clearHTML: function(){
77+
helper.e("html").style.backgroundColor="";
78+
}
7679
};
7780

7881
render.image=function(){
@@ -220,7 +223,8 @@ var background = (function(){
220223
};
221224

222225
varinit=function(){
223-
render.color();
226+
render.color.clearHTML();
227+
render.color.custom();
224228
render.image();
225229
render.blur();
226230
render.grayscale();

‎src/js/control.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ var control = (function(){
21412141
path: "background.color.custom",
21422142
type: "color",
21432143
func: function(){
2144-
background.render.color();
2144+
background.render.color.custom();
21452145
background.render.input.hex();
21462146
}
21472147
},{
@@ -2150,7 +2150,7 @@ var control = (function(){
21502150
type: "text",
21512151
valueMod: ["hexTextString"],
21522152
func: function(){
2153-
background.render.color();
2153+
background.render.color.custom();
21542154
background.render.input.picker();
21552155
}
21562156
},{

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="3.76.0";
3+
varcurrent="3.77.0";
44

55
varcompare=function(a,b){
66
varpa=a.split(".");

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "3.76.0",
5+
"version": "3.77.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)