Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/SMAPI.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@ViewData["Title"] - SMAPI.io</title>
<script>
(function () {
function applyTheme(mode) {
var actual = mode === 'system'
? (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
: mode;
document.documentElement.dataset.theme = actual;
document.documentElement.dataset.themeMode = mode;
}
applyTheme(localStorage.getItem('theme') || 'system');
window.setTheme = function (mode) {
applyTheme(mode);
if (mode === 'system') localStorage.removeItem('theme');
else localStorage.setItem('theme', mode);
};
})();
</script>
<link rel="stylesheet" href="@Url.ContentWithCacheBust("~/Content/css/main.css")" />
@RenderSection("Head", required: false)
</head>
Expand All @@ -28,6 +45,15 @@
</ul>

@RenderSection("SidebarExtra", required: false)

<h4>Theme</h4>
<ul id="theme-picker">
<li>
<a href="#" data-theme-mode="system" onclick="setTheme('system'); return false;">System</a> |
<a href="#" data-theme-mode="light" onclick="setTheme('light'); return false;">Light</a> |
<a href="#" data-theme-mode="dark" onclick="setTheme('dark'); return false;">Dark</a>
</li>
</ul>
</div>
<div id="content-column">
<div id="content">
Expand Down
7 changes: 5 additions & 2 deletions src/SMAPI.Web/wwwroot/Content/css/file-upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
margin: auto;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid #000088;
border: 1px solid var(--surface-border);
background: var(--surface);
color: var(--fg);
outline: none;
box-shadow: inset 0 0 1px 1px rgba(0, 0, 192, .2);
}
Expand All @@ -21,5 +23,6 @@
box-shadow: inset 0 0 1px 1px rgba(0, 0, 0, .2);
cursor: pointer;
border: 1px solid #008800;
background-color: #cfc;
background-color: var(--ok-bg);
color: var(--fg);
}
4 changes: 2 additions & 2 deletions src/SMAPI.Web/wwwroot/Content/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
h1 {
text-align: center;
font-size: 6em;
color: #000;
color: var(--fg);
}

#blurb {
Expand Down Expand Up @@ -110,7 +110,7 @@ h1 {
** Subsections
*********/
.area {
background: rgba(0, 170, 0, 0.2);
background: var(--area-bg);
padding: 0 1em 1em 1em;
margin-bottom: 1em;
}
Expand Down
18 changes: 9 additions & 9 deletions src/SMAPI.Web/wwwroot/Content/css/json-validator.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@

.banner.success {
border-color: green;
background: #CFC;
background: var(--ok-bg);
}

.banner.error {
border-color: red;
background: #FCC;
background: var(--error-bg);
}

.save-metadata {
Expand All @@ -79,7 +79,7 @@
** Validation results
*********/
.table {
border-bottom: 1px dashed #888888;
border-bottom: 1px dashed var(--border-strong);
margin-bottom: 5px;
}

Expand All @@ -89,25 +89,25 @@
}

.table {
border: 1px solid #000000;
background: #ffffff;
border: 1px solid var(--surface-border);
background: var(--surface);
border-radius: 5px;
border-spacing: 1px;
overflow: hidden;
cursor: default;
box-shadow: 1px 1px 1px 1px #dddddd;
box-shadow: 1px 1px 1px 1px var(--border);
}

.table tr {
background: #eee;
background: var(--surface-alt);
}

.table tr:nth-child(even) {
background: #fff;
background: var(--surface);
}

#output div.sunlight-line-highlight-active {
background-color: #eeeacc;
background-color: var(--warn-bg);
}

.footer-tip {
Expand Down
Loading