popover/selected menu improvements

This commit is contained in:
Henry Jameson 2020-01-24 00:02:16 +02:00
parent f7ea12c905
commit 53576df72a
5 changed files with 87 additions and 11 deletions

View File

@ -109,10 +109,13 @@
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
box-shadow: var(--popupShadow); box-shadow: var(--popupShadow);
min-width: 75%; min-width: 75%;
background: $fallback--bg; background-color: $fallback--bg;
background: var(--bg, $fallback--bg); background-color: var(--popover, $fallback--bg);
color: $fallback--lightText; color: $fallback--link;
color: var(--lightText, $fallback--lightText); color: var(--popoverText, $fallback--link);
--faint: var(--popoverFaintText, $fallback--faint);
--faintLink: var(--popoverFaintLink, $fallback--faint);
--icon: var(--popoverIcon, $fallback--icon);
} }
} }

View File

@ -9,7 +9,12 @@
border-radius: $fallback--btnRadius; border-radius: $fallback--btnRadius;
border-radius: var(--btnRadius, $fallback--btnRadius); border-radius: var(--btnRadius, $fallback--btnRadius);
background-color: $fallback--bg; background-color: $fallback--bg;
background-color: var(--bg, $fallback--bg); background-color: var(--popover, $fallback--bg);
color: $fallback--text;
color: var(--popoverText, $fallback--text);
--faint: var(--popoverFaintText, $fallback--faint);
--faintLink: var(--popoverFaintLink, $fallback--faint);
--icon: var(--popoverIcon, $fallback--icon);
} }
.popover-arrow { .popover-arrow {

View File

@ -223,7 +223,12 @@
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6); box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
box-shadow: var(--panelShadow); box-shadow: var(--panelShadow);
background-color: $fallback--bg; background-color: $fallback--bg;
background-color: var(--bg, $fallback--bg); background-color: var(--popover, $fallback--bg);
color: $fallback--link;
color: var(--popoverText, $fallback--link);
--faint: var(--popoverFaintText, $fallback--faint);
--faintLink: var(--popoverFaintLink, $fallback--faint);
--icon: var(--popoverIcon, $fallback--icon);
.button-icon:before { .button-icon:before {
width: 1.1em; width: 1.1em;

View File

@ -554,6 +554,35 @@
/> />
<ContrastRatio :contrast="previewContrast.highlightLink" /> <ContrastRatio :contrast="previewContrast.highlightLink" />
</div> </div>
<div class="color-item">
<h4>{{ $t('settings.style.advanced_colors.popover') }}</h4>
<ColorInput
v-model="popoverColorLocal"
name="popover"
:label="$t('settings.background')"
:fallback="previewTheme.colors.popover"
/>
<OpacityInput
v-model="popoverOpacityLocal"
name="popoverOpacity"
:fallback="previewTheme.opacity.popover"
:disabled="popoverOpacityLocal === 'transparent'"
/>
<ColorInput
v-model="popoverTextColorLocal"
name="popoverText"
:label="$t('settings.text')"
:fallback="previewTheme.colors.popoverText"
/>
<ContrastRatio :contrast="previewContrast.popoverText" />
<ColorInput
v-model="popoverLinkColorLocal"
name="popoverLink"
:label="$t('settings.links')"
:fallback="previewTheme.colors.popoverLink"
/>
<ContrastRatio :contrast="previewContrast.popoverLink" />
</div>
<div class="color-item"> <div class="color-item">
<h4>{{ $t('settings.style.advanced_colors.selectedPost') }}</h4> <h4>{{ $t('settings.style.advanced_colors.selectedPost') }}</h4>
<ColorInput <ColorInput

View File

@ -12,6 +12,8 @@ export const LAYERS = {
bg: 'underlay', bg: 'underlay',
highlight: 'bg', highlight: 'bg',
panel: 'bg', panel: 'bg',
popover: 'bg',
selectedMenu: 'popover',
btn: 'bg', btn: 'bg',
btnPanel: 'panel', btnPanel: 'panel',
btnTopBar: 'topBar', btnTopBar: 'topBar',
@ -140,6 +142,35 @@ export const SLOT_INHERITANCE = {
color: (mod, bg, text) => mixrgb(bg, text) color: (mod, bg, text) => mixrgb(bg, text)
}, },
popover: {
depends: ['bg'],
opacity: 'popover'
},
popoverFaintText: {
depends: ['faint'],
layer: 'popover',
textColor: true
},
popoverFaintLink: {
depends: ['faintLink'],
layer: 'popover',
textColor: 'preserve'
},
popoverText: {
depends: ['text'],
layer: 'popover',
textColor: true
},
popoverLink: {
depends: ['link'],
layer: 'popover',
textColor: 'preserve'
},
popoverIcon: {
depends: ['popover', 'popoverText'],
color: (mod, bg, text) => mixrgb(bg, text)
},
selectedPost: '--highlight', selectedPost: '--highlight',
selectedPostFaintText: { selectedPostFaintText: {
depends: ['highlightFaintText'], depends: ['highlightFaintText'],
@ -170,28 +201,31 @@ export const SLOT_INHERITANCE = {
color: (mod, bg, text) => mixrgb(bg, text) color: (mod, bg, text) => mixrgb(bg, text)
}, },
selectedMenu: '--highlight', selectedMenu: {
depends: ['popover'],
color: (mod, bg) => brightness(5 * mod, bg).rgb
},
selectedMenuFaintText: { selectedMenuFaintText: {
depends: ['highlightFaintText'], depends: ['highlightFaintText'],
layer: 'highlight', layer: 'selectedMenu',
variant: 'selectedMenu', variant: 'selectedMenu',
textColor: true textColor: true
}, },
selectedMenuFaintLink: { selectedMenuFaintLink: {
depends: ['highlightFaintLink'], depends: ['highlightFaintLink'],
layer: 'highlight', layer: 'selectedMenu',
variant: 'selectedMenu', variant: 'selectedMenu',
textColor: 'preserve' textColor: 'preserve'
}, },
selectedMenuText: { selectedMenuText: {
depends: ['highlightText'], depends: ['highlightText'],
layer: 'highlight', layer: 'selectedMenu',
variant: 'selectedMenu', variant: 'selectedMenu',
textColor: true textColor: true
}, },
selectedMenuLink: { selectedMenuLink: {
depends: ['highlightLink'], depends: ['highlightLink'],
layer: 'highlight', layer: 'selectedMenu',
variant: 'selectedMenu', variant: 'selectedMenu',
textColor: 'preserve' textColor: 'preserve'
}, },