Uses CSS variables for common definitions, to allow for themes

This commit is contained in:
Alicia Sykes 2021-04-14 21:05:37 +01:00
parent 2baccdb718
commit e31e6d4239
14 changed files with 90 additions and 41 deletions

View File

@ -93,7 +93,7 @@ export default {
.collapsable { .collapsable {
padding: 5px; padding: 5px;
margin: 10px; margin: 10px;
border-radius: $curve-factor; border-radius: var(--curve-factor);
background: var(--primary); background: var(--primary);
// background: -webkit-linear-gradient(to left top, #9F86FF, #1CA8DD, #007AE1); // background: -webkit-linear-gradient(to left top, #9F86FF, #1CA8DD, #007AE1);
// background: linear-gradient(to left top, #9F86FF, #1CA8DD, #007AE1); // background: linear-gradient(to left top, #9F86FF, #1CA8DD, #007AE1);
@ -140,7 +140,7 @@ export default {
display: block; display: block;
padding: 0.25rem; padding: 0.25rem;
cursor: pointer; cursor: pointer;
border-radius: $curve-factor; border-radius: var(--curve-factor);
transition: all 0.25s ease-out; transition: all 0.25s ease-out;
text-align: left; text-align: left;
color: var(--background-transparent); color: var(--background-transparent);

View File

@ -104,8 +104,9 @@ export default {
background: #607d8b33; background: #607d8b33;
text-align: center; text-align: center;
padding: 2px; padding: 2px;
border: 2px solid transparent; outline: 2px solid transparent;
border-radius: $curve-factor; border: 1px solid var(--outline-color);
border-radius: var(--curve-factor);
box-shadow: 1px 1px 2px #373737; box-shadow: 1px 1px 2px #373737;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
@ -113,8 +114,7 @@ export default {
background: #607d8b4d; background: #607d8b4d;
} }
&:focus { &:focus {
border: 2px solid var(--primary); outline: 2px solid var(--primary);
outline: none;
} }
&.short { &.short {
height: 18px; height: 18px;

View File

@ -43,7 +43,7 @@ export default {
width: 1rem; width: 1rem;
margin: 2px; margin: 2px;
path { path {
fill: var(--primary-transparent); fill: var(--primary);
} }
} }
&.top svg { top: 0; } &.top svg { top: 0; }

View File

@ -27,16 +27,17 @@ export default {
footer { footer {
padding: 0.5rem; padding: 0.5rem;
text-align: center; text-align: center;
color: #5e6474; color: var(--medium-grey);
opacity: 0.5; opacity: var(--dimming-factor);
background: #05070e; background: var(--background-darker);
margin-top: 1rem; margin-top: 1rem;
border-top: 1px solid var(--outline-color);
} }
footer a{ footer a{
color: #5e6474; color: var(--medium-grey);
&:hover { &:hover {
color: #9F86FF; color: var(--primary);
} }
} }

View File

@ -23,7 +23,7 @@ nav {
margin: 0.5rem; margin: 0.5rem;
outline: none; outline: none;
border: none; border: none;
border-radius: 5px; border-radius: var(--curve-factor);
background: #607d8b33; background: #607d8b33;
-webkit-box-shadow: 1px 1px 2px #232323; -webkit-box-shadow: 1px 1px 2px #232323;
box-shadow: 1px 1px 2px #232323; box-shadow: 1px 1px 2px #232323;

View File

@ -30,9 +30,10 @@ export default {
margin: 0; margin: 0;
} }
span.subtitle { span.subtitle {
color: var(--primary-transparent); color: var(--primary);
font-style: italic; font-style: italic;
text-shadow: 1px 1px 2px #130f23; text-shadow: 1px 1px 2px #130f23;
opacity: var(--dimming-factor);
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
text-align: center; text-align: center;

View File

@ -3,11 +3,11 @@
<span class="options-label">Icon Size</span> <span class="options-label">Icon Size</span>
<div class="display-options"> <div class="display-options">
<IconSmall @click="updateIconSize('small')" v-tooltip="tooltip('Small')" <IconSmall @click="updateIconSize('small')" v-tooltip="tooltip('Small')"
:class="`layout-icon ${iconSize === 'small' ? 'selected' : ''}`" /> :class="`layout-icon ${iconSize === 'small' ? 'selected' : ''}`" tabindex="2" />
<IconMedium @click="updateIconSize('medium')" v-tooltip="tooltip('Medium')" <IconMedium @click="updateIconSize('medium')" v-tooltip="tooltip('Medium')"
:class="`layout-icon ${iconSize === 'medium' ? 'selected' : ''}`" /> :class="`layout-icon ${iconSize === 'medium' ? 'selected' : ''}`" tabindex="2" />
<IconLarge @click="updateIconSize('large')" v-tooltip="tooltip('Large')" <IconLarge @click="updateIconSize('large')" v-tooltip="tooltip('Large')"
:class="`layout-icon ${iconSize === 'large' ? 'selected' : ''}`" /> :class="`layout-icon ${iconSize === 'large' ? 'selected' : ''}`" tabindex="2" />
</div> </div>
</div> </div>
</template> </template>
@ -50,10 +50,10 @@ span.options-label {
} }
.display-options { .display-options {
color: var(--primary-transparent); color: var(--primary);
svg { svg {
path { path {
fill: var(--primary-transparent); fill: var(--primary);
} }
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
@ -62,11 +62,11 @@ span.options-label {
text-align: center; text-align: center;
background: var(--background); background: var(--background);
border: 1px solid currentColor; border: 1px solid currentColor;
border-radius: 4px; border-radius: var(--curve-factor);
opacity: 0.8; opacity: var(--dimming-factor);
cursor: pointer; cursor: pointer;
&:hover, &.selected { &:hover, &.selected {
background: var(--primary-transparent); background: var(--primary);
path { fill: var(--background); } path { fill: var(--background); }
} }
} }

View File

@ -90,7 +90,7 @@ export default {
color: var(--primary); color: var(--primary);
background: var(--background-darker); background: var(--background-darker);
padding: 4px; padding: 4px;
border-radius: 5px; border-radius: var(--curve-factor);
} }
.close { /* The little exit icon, in top-right */ .close { /* The little exit icon, in top-right */
float: right; float: right;
@ -104,7 +104,7 @@ export default {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
border: 1px solid var(--primary); border: 1px solid var(--primary);
opacity: 0.6; opacity: var(--dimming-factor);
} }
} }
} }

View File

@ -3,11 +3,11 @@
<span class="options-label">Layout</span> <span class="options-label">Layout</span>
<div class="display-options"> <div class="display-options">
<IconDeafault @click="updateDisplayLayout('default')" v-tooltip="tooltip('Auto')" <IconDeafault @click="updateDisplayLayout('default')" v-tooltip="tooltip('Auto')"
:class="`layout-icon ${displayLayout === 'default' ? 'selected' : ''}`" /> :class="`layout-icon ${displayLayout === 'default' ? 'selected' : ''}`" tabindex="2" />
<IconHorizontal @click="updateDisplayLayout('horizontal')" v-tooltip="tooltip('Horizontal')" <IconHorizontal @click="updateDisplayLayout('horizontal')" v-tooltip="tooltip('Horizontal')"
:class="`layout-icon ${displayLayout === 'horizontal' ? 'selected' : ''}`" /> :class="`layout-icon ${displayLayout === 'horizontal' ? 'selected' : ''}`" tabindex="2" />
<IconVertical @click="updateDisplayLayout('vertical')" v-tooltip="tooltip('Vertical')" <IconVertical @click="updateDisplayLayout('vertical')" v-tooltip="tooltip('Vertical')"
:class="`layout-icon ${displayLayout === 'vertical' ? 'selected' : ''}`" /> :class="`layout-icon ${displayLayout === 'vertical' ? 'selected' : ''}`" tabindex="2" />
</div> </div>
</div> </div>
</template> </template>
@ -50,10 +50,10 @@ span.options-label {
} }
.display-options { .display-options {
color: var(--primary-transparent); color: var(--primary);
svg { svg {
path { path {
fill: var(--primary-transparent); fill: var(--primary);
} }
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
@ -62,10 +62,10 @@ span.options-label {
text-align: center; text-align: center;
background: var(--background); background: var(--background);
border: 1px solid currentColor; border: 1px solid currentColor;
border-radius: 4px; border-radius: var(--curve-factor);
cursor: pointer; cursor: pointer;
&:hover, &.selected { &:hover, &.selected {
background: var(--primary-transparent); background: var(--primary);
path { fill: var(--background); } path { fill: var(--background); }
} }
} }

View File

@ -62,7 +62,9 @@ export default {
background: linear-gradient(0deg, var(--background) 0%, var(--background-darker) 100%); background: linear-gradient(0deg, var(--background) 0%, var(--background-darker) 100%);
} }
form { form {
border-radius: 0 0 20px 0; display: flex;
align-items: center;
border-radius: 0 0 var(--curve-factor-navbar) 0;
padding: 0 0.2rem 0.2rem 0; padding: 0 0.2rem 0.2rem 0;
background: var(--background-darker); background: var(--background-darker);
label { label {
@ -74,15 +76,18 @@ export default {
input { input {
display: inline-block; display: inline-block;
width: 200px; width: 200px;
height: 1rem;
padding: 0.5rem; padding: 0.5rem;
margin: 0.5rem; margin: 0.5rem;
outline: none; outline: none;
border: none; border: none;
border-radius: 12px; border-radius: var(--curve-factor);
background: var(--background); background: var(--background);
color: var(--primary); color: var(--primary);
border: 1px solid var(--outline-color);
&:focus { &:focus {
background: var(--background-transparent); border-color: var(--primary);
opacity: var(--dimming-factor);
} }
} }
.clear-search { .clear-search {
@ -92,7 +97,7 @@ export default {
padding: 0 0.4rem; padding: 0 0.4rem;
font-style: normal; font-style: normal;
font-size: 1.5rem; font-size: 1.5rem;
opacity: 0.5; opacity: var(--dimming-factor);
border-radius: 50px; border-radius: 50px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {

View File

@ -62,12 +62,12 @@ export default {
align-items: flex-end; align-items: flex-end;
justify-content: flex-end; justify-content: flex-end;
flex: 1; flex: 1;
padding: 0 1rem; padding: 0.5rem 1rem;
border-radius: 20px 0 0; border-radius: var(--curve-factor-navbar) 0 0;
background: var(--background); background: var(--background);
div { div {
margin-left: 0.5rem; margin-left: 0.5rem;
opacity: 0.85; opacity: var(--dimming-factor);
&:hover { opacity: 1; } &:hover { opacity: 1; }
} }
} }

View File

@ -5,7 +5,7 @@
:options="themeNames" :options="themeNames"
v-model="selectedTheme" v-model="selectedTheme"
class="theme-dropdown" class="theme-dropdown"
:tabindex="100" :tabindex="2"
/> />
</div> </div>
</template> </template>
@ -43,6 +43,13 @@ export default {
this.themeHelper.theme = 'Deafault'; this.themeHelper.theme = 'Deafault';
}); });
}, },
methods: {
toggleLocalTheme(newTheme) {
const htmlTag = document.getElementsByTagName('html')[0];
if (htmlTag.hasAttribute('data-theme')) htmlTag.removeAttribute('data-theme');
htmlTag.setAttribute('data-theme', newTheme);
},
},
}; };
</script> </script>
@ -53,6 +60,7 @@ export default {
.theme-dropdown { .theme-dropdown {
div.vs__dropdown-toggle { div.vs__dropdown-toggle {
border-color: var(--primary); border-color: var(--primary);
border-radius: var(--curve-factor);
min-width: 10rem; min-width: 10rem;
height: 1.8rem; height: 1.8rem;
font-size: 0.85rem; font-size: 0.85rem;

View File

@ -6,8 +6,14 @@
--primary: #5cabca; --primary: #5cabca;
/* Modified Colors */ /* Modified Colors */
--primary-transparent: #5cabcab3;
--background-transparent: #0b1021cc; --background-transparent: #0b1021cc;
--medium-grey: #5e6474;
--outline-color: none;
--curve-factor: 5px;
--curve-factor-navbar: 16px;
--dimming-factor: 0.8;
/* Semi-Transparent Black*/ /* Semi-Transparent Black*/
--transparent-70: #000000b3; --transparent-70: #000000b3;
@ -15,3 +21,27 @@
--transparent-30: #0000004d; --transparent-30: #0000004d;
} }
html[data-theme='hacker-red'] {
--background: #000;
--background-darker: #000;
--primary: red;
--outline-color: red;
--curve-factor: 0px;
}
html[data-theme='high-contrast-light'] {
--background: #fff;
--background-darker: #fff;
--primary: #000;
--outline-color: #000;
--curve-factor: 0px;
}
html[data-theme='high-contrast-dark'] {
--background: #000;
--background-darker: #000;
--primary: #fff;
--outline-color: #fff;
--curve-factor: 0px;
}

View File

@ -201,7 +201,11 @@ export default {
width: fit-content; width: fit-content;
margin: 2rem auto; margin: 2rem auto;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
border-radius: 4px; border-radius: var(--curve-factor);
}
.filter-container {
border-bottom: 1px solid var(--outline-color);
} }
</style> </style>