1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

Updates themes to use vars (#541)

* Adds vars for themeing

* Uses correct color vars

* Adds more vars

* Adds other variables

* Use data attribute only

* Adds animation and unifies color

* Fixes tests

* Fixes search

* Adds docker ignore

* Fixes search text

* Fixes int tests

* Fixes int tests again
This commit is contained in:
Amir Raminfar
2020-06-27 14:32:34 -07:00
committed by GitHub
parent 3d68a8ddb0
commit 8fa672edd1
16 changed files with 153 additions and 160 deletions

View File

@@ -83,7 +83,7 @@ export default {
document.documentElement.classList.add("has-custom-scrollbars");
}
if (this.hasLightTheme) {
document.documentElement.classList.add("has-light-theme");
document.documentElement.setAttribute("data-theme", "light");
}
this.menuWidth = this.settings.menuWidth;
},
@@ -97,12 +97,12 @@ export default {
},
hasLightTheme(newValue, oldValue) {
if (newValue) {
document.documentElement.classList.add("has-light-theme");
document.documentElement.setAttribute("data-theme", "light");
} else {
document.documentElement.classList.remove("has-light-theme");
}
document.documentElement.removeAttribute("data-theme");
}
},
},
computed: {
...mapState(["activeContainers", "isMobile", "settings"]),
...mapGetters(["visibleContainers"]),
@@ -132,9 +132,9 @@ export default {
<style scoped lang="scss">
::v-deep .splitpanes--vertical > .splitpanes__splitter {
min-width: 3px;
background: #666;
background: var(--border-color);
&:hover {
background: rgb(255, 221, 87);
background: var(--border-hover-color);
}
}
@@ -159,18 +159,6 @@ export default {
&:hover {
left: -25px;
}
html.has-light-theme & {
background-color: #7d7d68;
}
}
}
</style>
<style lang="scss">
html.has-light-theme .splitpanes--vertical > .splitpanes__splitter {
background: #DCDCDC;
&:hover {
background: #d8f0ca;
}
}
</style>

View File

@@ -92,8 +92,8 @@ export default {
background-color: #262626;
color: #258ccd;
html.has-light-theme & {
background-color: #F0F0F0;
[data-theme="light"] & {
background-color: #f0f0f0;
color: #009900;
padding-left: 5px;
padding-right: 5px;
@@ -110,8 +110,8 @@ li.event {
::v-deep mark {
border-radius: 2px;
background-color: #ffdd57;
animation: pops 0.2s ease-out;
background-color: var(--secondary-color);
animation: pops 200ms ease-out;
display: inline-block;
}

View File

@@ -2,7 +2,7 @@
<aside>
<a
role="button"
class="navbar-burger burger is-white is-hidden-tablet is-pulled-right"
class="navbar-burger burger is-hidden-tablet is-pulled-right"
@click="showNav = !showNav"
:class="{ 'is-active': showNav }"
>
@@ -54,7 +54,7 @@ aside {
top: 0;
left: 0;
right: 0;
background: #222;
background: var(--scheme-main-ter);
z-index: 2;
max-height: 100vh;
overflow: auto;
@@ -68,8 +68,12 @@ aside {
overflow: hidden;
}
.burger.is-white {
color: #fff;
.title {
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
}
.burger {
color: var(--body-color);
}
.is-hidden-mobile.is-active {

View File

@@ -3,7 +3,7 @@
<svg width="100" height="100" viewBox="0 0 100 100">
<circle r="44" cx="50" cy="50" :style="{ '--progress': scrollProgress }" />
</svg>
<div class="percent columns is-vcentered is-centered">
<div class="percent columns is-vcentered is-centered has-text-weight-light">
<span class="column is-narrow is-paddingless is-size-2">
{{ Math.ceil(scrollProgress * 100) }}
</span>
@@ -73,19 +73,16 @@ export default {
display: inline-block;
position: relative;
circle {
fill: #000;
fill-opacity: 0.6;
transition: stroke-dashoffset 0.35s ease-out;
fill: var(--scheme-main-ter);
fill-opacity: 0.8;
transition: stroke-dashoffset 250ms ease-out;
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke: #00d1b2;
stroke: var(--primary-color);
stroke-dashoffset: calc(276.32px - var(--progress) * 276.32px);
stroke-dasharray: 276.32px 276.32px;
stroke-width: 3;
will-change: stroke-dashoffset;
html.has-light-theme & {
fill-opacity: 0.1;
}
}
.percent {
@@ -94,10 +91,6 @@ export default {
top: 0;
right: 0;
bottom: 0;
html.has-light-theme & {
color: #333;
}
}
}
</style>

View File

@@ -13,12 +13,7 @@
<div class="scrollbar-notification">
<transition name="fade">
<button
class="button"
:class="hasMore ? 'is-warning' : 'is-primary'"
@click="scrollToBottom('instant')"
v-show="paused"
>
<button class="button" :class="hasMore ? 'has-more' : ''" @click="scrollToBottom('instant')" v-show="paused">
<icon name="download"></icon>
</button>
</transition>
@@ -93,10 +88,10 @@ section {
.scrollbar-progress {
text-align: right;
margin-right: 125px;
margin-right: 110px;
.scroll-progress {
position: fixed;
top: 30px;
top: 60px;
z-index: 2;
}
}
@@ -107,6 +102,34 @@ section {
button {
position: fixed;
bottom: 30px;
background-color: var(--secondary-color);
transition: background-color 1s ease-out;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
border: none !important;
&.has-more {
background-color: var(--primary-color);
animation-name: bounce;
animation-duration: 1000ms;
animation-fill-mode: both;
color: #fff;
}
}
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-30px);
}
60% {
transform: translateY(-15px);
}
}

View File

@@ -75,17 +75,26 @@ export default {
width: 350px;
position: fixed;
padding: 10px;
background: rgba(50, 50, 50, 0.9);
background: var(--scheme-main-ter);
top: 0;
right: 0;
border-radius: 0 0 0 5px;
z-index: 10;
}
.delete {
margin-left: 1em;
}
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
.icon {
.delete {
margin-left: 1em;
}
.icon {
padding: 10px 3px;
}
.input {
color: var(--body-color);
&::placeholder {
color: var(--border-color);
}
}
}
</style>

View File

@@ -79,10 +79,6 @@ aside {
overflow: hidden;
}
.burger.is-white {
color: #fff;
}
.is-hidden-mobile.is-active {
display: block !important;
}
@@ -90,39 +86,7 @@ aside {
h1.title {
font-family: "Gafata", sans-serif;
html.has-light-theme & {
text-shadow: 1px 0px #ffdd57;
&.has-text-warning {
color: #ffcc00;
}
}
}
html.has-light-theme {
.menu-label {
color: #595959;
}
.menu-list a {
color: #444;
&:hover {
background-color: #eee8e7;
}
&.is-active {
background-color: #d8f0ca;
border-color: #d8f0ca;
}
}
.button {
&:active,
&.is-active {
color: #ffdd57;
}
}
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
}
li.exited a {
@@ -133,7 +97,7 @@ li.exited a {
transition: transform 0.2s ease-out;
&.is-active {
pointer-events: none;
color: #00d1b2;
color: var(--primary-color);
}
.router-link-exact-active & {
visibility: hidden;

View File

@@ -4,7 +4,10 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dozzle</title>
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono|Gafata&display=swap" rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css2?family=Gafata&family=Roboto:wght@300;400&family=Roboto+Mono&display=swap"
rel="stylesheet"
/>
<script type="application/json" id="config__json">
{
"base": "{{ .Base }}",

View File

@@ -1,5 +1,5 @@
<template>
<div class="hero is-fullheight is-dark">
<div class="hero is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">Please choose a container from the list to view the logs</h1>
@@ -14,17 +14,3 @@ export default {
name: "Default",
};
</script>
<style scoped>
.hero.is-dark {
color: #ddd;
background-color: #111;
html.has-light-theme & {
background-color: #F8F8F8;
.title {
color: #555;
}
}
}
</style>

View File

@@ -118,7 +118,8 @@ export default {
},
computed: {
...mapState(["settings"]),
...["search", "size", "smallerScrollbars", "showTimestamp", "showAllContainers", "lightTheme"].reduce((map, name) => {
...["search", "size", "smallerScrollbars", "showTimestamp", "showAllContainers", "lightTheme"].reduce(
(map, name) => {
map[name] = {
get() {
return this.settings[name];
@@ -128,13 +129,15 @@ export default {
},
};
return map;
}, {}),
},
{}
),
},
};
</script>
<style lang="scss" scoped>
.title {
color: #eee;
color: var(--title-color);
}
a.next-release {
@@ -151,20 +154,9 @@ a.next-release {
}
.has-underline {
border-bottom: 1px solid #fff;
border-bottom: 1px solid var(--title-color);
padding: 1em 0px;
margin-bottom: 1em;
html.has-light-theme & {
border-bottom: 1px solid #DCDCDC;
}
}
html.has-light-theme .title {
&.is-4,
&.is-6 {
color: #555;
}
}
.item {
@@ -174,10 +166,5 @@ html.has-light-theme .title {
code {
border-radius: 4px;
background-color: #444;
html.has-light-theme & {
background-color: #999;
color: #FFF;
}
}
</style>

View File

@@ -2,7 +2,7 @@
exports[`<Index /> renders correctly 1`] = `
<div
class="hero is-fullheight is-dark"
class="hero is-fullheight"
>
<div
class="hero-body"

View File

@@ -1,7 +1,22 @@
@charset "utf-8";
@import "~bulma/sass/utilities/initial-variables.sass";
$menu-item-active-background-color: hsl(171, 100%, 41%);
$menu-item-color: hsl(0, 6%, 87%);
$body-family: "Roboto", sans-serif;
$body-background-color: var(--body-background-color);
$body-color: var(--body-color);
$scheme-main: var(--scheme-main);
$scheme-main-bis: var(--scheme-main-bis);
$scheme-main-ter: var(--scheme-main-ter);
$border: var(--border-color);
$border-hover: var(--border-hover-color);
$menu-item-active-background-color: var(--menu-item-active-background-color);
$menu-item-color: var(--menu-item-color);
$menu-item-hover-background-color: var(--menu-item-hover-background-color);
$title-color: var(--title-color);
@import "~bulma";
@import "../node_modules/splitpanes/dist/splitpanes.css";
@@ -9,24 +24,51 @@ $menu-item-color: hsl(0, 6%, 87%);
@import "~buefy/src/scss/components/_dropdown";
@import "~buefy/src/scss/components/_switch";
html {
--scheme-main: #{$black};
--scheme-main-bis: #{$black-bis};
--scheme-main-ter: #{$black-ter};
--border-color: #{$grey-darker};
--border-hover-color: var(--secondary-color);
--primary-color: #{$turquoise};
--secondary-color: #{$yellow};
--body-background-color: #{$black-bis};
--body-color: #{$grey-lighter};
--menu-item-active-background-color: var(--primary-color);
--menu-item-color: hsl(0, 6%, 87%);
--menu-item-hover-background-color: #{$white-ter};
--title-color: #{$grey-lightest};
}
[data-theme="light"] {
--scheme-main: #{$white};
--scheme-main-bis: #{$white-bis};
--scheme-main-ter: #{$white-ter};
--border-color: #{$grey-lighter};
--border-hover-color: var(--secondary-color);
--primary-color: #{$turquoise};
--secondary-color: #d8f0ca;
--body-background-color: #{$white-bis};
--body-color: #{$grey-darker};
--menu-item-color: #{$grey-dark};
--menu-item-hover-background-color: #eee8e7;
--title-color: #{$grey-dark};
}
html {
overflow-x: unset;
overflow-y: unset;
scroll-snap-type: y proximity;
background-color: #111;
&.has-light-theme {
background-color: #F8F8F8;
}
}
body {
font-family: "Roboto", sans-serif;
color: #ddd;
html.has-light-theme & {
color: #333;
}
}
html.has-custom-scrollbars {
@@ -74,11 +116,4 @@ html.has-custom-scrollbars {
color: unset;
border-color: transparent;
}
html.has-light-theme & {
&:hover {
background: #7d7d68 !important;
border-color: #7d7d68 !important;
}
}
}

View File

@@ -0,0 +1 @@
node_modules

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 61 KiB