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 {
padding: 5px;
margin: 10px;
border-radius: $curve-factor;
border-radius: var(--curve-factor);
background: var(--primary);
// background: -webkit-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;
padding: 0.25rem;
cursor: pointer;
border-radius: $curve-factor;
border-radius: var(--curve-factor);
transition: all 0.25s ease-out;
text-align: left;
color: var(--background-transparent);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
:options="themeNames"
v-model="selectedTheme"
class="theme-dropdown"
:tabindex="100"
:tabindex="2"
/>
</div>
</template>
@ -43,6 +43,13 @@ export default {
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>
@ -53,6 +60,7 @@ export default {
.theme-dropdown {
div.vs__dropdown-toggle {
border-color: var(--primary);
border-radius: var(--curve-factor);
min-width: 10rem;
height: 1.8rem;
font-size: 0.85rem;

View File

@ -6,12 +6,42 @@
--primary: #5cabca;
/* Modified Colors */
--primary-transparent: #5cabcab3;
--background-transparent: #0b1021cc;
--medium-grey: #5e6474;
--outline-color: none;
--curve-factor: 5px;
--curve-factor-navbar: 16px;
--dimming-factor: 0.8;
/* Semi-Transparent Black*/
--transparent-70: #000000b3;
--transparent-50: #00000080;
--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;
margin: 2rem auto;
padding: 0.5rem 1rem;
border-radius: 4px;
border-radius: var(--curve-factor);
}
.filter-container {
border-bottom: 1px solid var(--outline-color);
}
</style>