Skip to content

Commit 820ba62

Browse files
committed
fix: notch status bar doesn't match theme color (#918)
Resolves #918
1 parent 3c7934a commit 820ba62

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

_includes/head.html

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
<!--
2-
The Head
3-
-->
1+
<!-- The Head -->
42

53
<head>
64
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
5+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
6+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
7+
<meta name="apple-mobile-web-app-capable" content="yes">
8+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
9+
<meta
10+
name="viewport"
11+
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
12+
>
813

914
{% if page.layout == 'home' or page.layout == 'post' %}
10-
1115
{% if site.google_analytics.pv.proxy_endpoint %}
1216
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
1317
{% endif %}
1418

1519
{% if site.google_analytics.pv.cache_path %}
1620
<meta name="pv-cache-path" content="{{ site.google_analytics.pv.cache_path | relative_url }}">
1721
{% endif %}
18-
1922
{% endif %}
2023

2124
{% capture seo_tags %}
@@ -40,40 +43,34 @@
4043
{% endif %}
4144

4245
{% assign seo_tags = seo_tags | replace: target, replacement %}
43-
4446
{% endunless %}
45-
4647
{% endif %}
4748

4849
{{ seo_tags }}
4950

5051
<title>
51-
{%- unless page.layout == "home" -%}
52-
{{ page.title | append: " | "}}
53-
{%- endunless -%}
52+
{%- unless page.layout == 'home' -%}
53+
{{ page.title | append: ' | ' }}
54+
{%- endunless -%}
5455
{{ site.title }}
5556
</title>
5657

5758
{% include favicons.html %}
5859

5960
{% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
60-
6161
<link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
6262

6363
{% else %}
64-
6564
{% for cdn in site.data.assets[origin].cdns %}
6665
<link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
6766
<link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
6867
{% endfor %}
6968

7069
<link rel="stylesheet" href="{{ site.data.assets[origin].webfonts | relative_url }}">
71-
7270
{% endif %}
7371

7472
<!-- GA -->
75-
{% if jekyll.environment == 'production'
76-
and site.google_analytics.id != empty and site.google_analytics.id %}
73+
{% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
7774
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
7875
<link rel="dns-prefetch" href="https://www.google-analytics.com">
7976

@@ -82,7 +79,11 @@
8279

8380
{% if site.google_analytics.pv.proxy_endpoint %}
8481
{% assign proxy_url = site.google_analytics.pv.proxy_endpoint
85-
| replace: "https://", "" | split: "/" | first | prepend: "https://" %}
82+
| replace: 'https://', ''
83+
| split: '/'
84+
| first
85+
| prepend: 'https://'
86+
%}
8687
<link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
8788
<link rel="dns-prefetch" href="{{ proxy_url }}">
8889
{% endif %}

_sass/addon/commons.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ html {
2929
}
3030

3131
body {
32-
background: var(--body-bg);
32+
background: var(--main-bg);
33+
padding: env(safe-area-inset-top) env(safe-area-inset-right)
34+
env(safe-area-inset-bottom) env(safe-area-inset-left);
3335
color: var(--text-color);
3436
-webkit-font-smoothing: antialiased;
3537
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;

_sass/colors/dark-typography.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
@mixin dark-scheme {
66
/* Framework color */
7-
--body-bg: var(--main-bg);
8-
--mask-bg: rgb(68, 69, 70);
97
--main-bg: rgb(27, 27, 30);
8+
--mask-bg: rgb(68, 69, 70);
109
--main-border-color: rgb(44, 45, 45);
1110

1211
/* Common color */

_sass/colors/light-typography.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
@mixin light-scheme {
66
/* Framework color */
7-
--body-bg: #fafafa;
8-
--mask-bg: #c1c3c5;
97
--main-bg: white;
8+
--mask-bg: #c1c3c5;
109
--main-border-color: #f3f3f3;
1110

1211
/* Common color */

0 commit comments

Comments
 (0)