Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up theming #454

Merged
merged 1 commit into from
Jul 5, 2023
Merged
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
122 changes: 0 additions & 122 deletions libretranslate/static/css/dark-theme.css

This file was deleted.

129 changes: 100 additions & 29 deletions libretranslate/static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,73 @@
/* Custom styles for LibreTranslate page */

html,
body,
select {
:root {
--pri-bg-color: #fff;
--sec-bg-color: #f3f3f3;
--code-bg-color: #fbfbfb;
--border-color: #ccc;
--fg-color: #000;
--nav-fg-color: #fff;
--accent-color: #1565c0;
}

@media (prefers-color-scheme: dark) {
:root {
--pri-bg-color: #111;
--sec-bg-color: #222;
--code-bg-color: #222;
--border-color: #444;
--fg-color: #fff;
}

.token.atrule, .token.attr-value, .token.keyword {
color: #40b5e8;
}

.language-css .token.string, .style .token.string,
.token.entity, .token.operator, .token.url {
color: #eecfab;
background: hsla(0,0%, 15%, .5);
}

.token.attr-name, .token.builtin, .token.char,
.token.inserted, .token.selector, .token.string {
color: #acd25f;
}

.token.boolean, .token.constant, .token.deleted, .token.number,
.token.property, .token.symbol, .token.tag {
color: #ff8bcc;
}

.token.class-name, .token.function {
color: #ff7994;
}
}

html, body, select {
font-size: 16px;
font-family: Arial, Helvetica, sans-serif !important;
}

a {
text-decoration: underline;
body {
background-color: var(--pri-bg-color);
color: var(--fg-color);
}

a.noline{
text-decoration: none;
nav, #nav, #nav-mobile, .locale-panel, .page-footer {
background-color: var(--accent-color);
}

nav, nav .material-icons {
color: var(--nav-fg-color);
}

.material-icons {
color: var(--fg-color);
}

a:not(.noline) {
text-decoration: underline;
}

#app {
Expand All @@ -39,7 +94,7 @@ h3.header {
position: relative;
}

.top-nav .locale-panel{
.top-nav .locale-panel {
position: absolute;
top: 64px;
height: 68px;
Expand All @@ -66,7 +121,6 @@ h3.header {
display: block;
}


.locale-panel select{
display: block;
height: 32px;
Expand Down Expand Up @@ -121,6 +175,10 @@ h3.header {
float: none;
}

select {
color: var(--fg-color);
}

.language-select {
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -152,7 +210,7 @@ h3.header {
width: 0.5em;
height: 0.5em;
margin: 0 0 0.25rem -0.75rem;
border: solid black;
border: solid var(--fg-color);
border-width: 0 2px 2px 0;
display: inline-block;
padding: 3px;
Expand All @@ -171,6 +229,10 @@ h3.header {
position: relative;
}

.textarea-container .material-icons {
color: #666;
}

.btn-delete-text {
position: absolute;
right: 1.5rem;
Expand Down Expand Up @@ -202,8 +264,8 @@ h3.header {
}

.btn-switch-type {
background-color: #fff;
color: #1565C0;
background-color: var(--sec-bg-color);
color: var(--fg-color);
display: flex;
align-items: center;
margin: .5rem;
Expand All @@ -214,19 +276,22 @@ h3.header {
}

.btn-switch-type:hover {
background-color: #eee !important;
color: #1565C0;
background-color: var(--sec-bg-color);
}

.btn-switch-type.active {
background-color: #1565C0 !important;
color: #fff;
background-color: var(--accent-color);
color: #FFF;
}

.btn-switch-type.active .material-icons {
color: #FFF;
}

.file-dropzone {
font-size: 1.1rem;
border: 1px solid #ccc;
background: #f3f3f3;
background: var(--sec-bg-color);
border: 1px solid var(--border-color);
padding: 1rem 2rem 1rem 1.5rem;
min-height: 220px;
position: relative;
Expand All @@ -253,8 +318,9 @@ h3.header {
.btn-blue {
color: #1565C0;
}

.btn-action:disabled {
color: #666;
color: #666;
}

.btn-action span {
Expand Down Expand Up @@ -296,8 +362,8 @@ h3.header {
.textarea-container textarea {
font-size: 1.25rem;
resize: none;
border: 1px solid #ccc;
background: #f3f3f3;
background: var(--sec-bg-color);
border: 1px solid var(--border-color);
padding: 1rem 2rem 1rem 1.5rem;
overflow-y: hidden;
}
Expand All @@ -316,15 +382,20 @@ h3.header {
.code {
font-size: 90%;
padding: 1rem 1.5rem;
border: 1px solid #ccc;
background: #fbfbfb;
background: var(--code-bg-color);
border: 1px solid var(--border-color);
overflow: auto;
font-family: monospace;
min-height: 280px;
width: 100%;
overflow: auto;
}

code[class*="language-"], pre[class*="language-"] {
color: var(--fg-color);
text-shadow: 0 1px var(--pri-bg-color);
}

.page-footer .footer-copyright {
justify-content: center;
padding: 0.5rem 1rem;
Expand All @@ -348,12 +419,6 @@ h3.header {
color: white;
}

@media (min-width: 993px) {
nav button.sidenav-trigger {
display: none;
}
}

#download-btn-wrapper {
display: flex;
justify-content: center;
Expand Down Expand Up @@ -384,3 +449,9 @@ h3.header {
display: none;
}
}

@media (min-width: 993px) {
nav button.sidenav-trigger {
display: none;
}
}
Loading