better v1 detection, better menu-item consistency
This commit is contained in:
parent
d3b5f76486
commit
c83ddb0b2b
|
@ -30,17 +30,44 @@ export default {
|
||||||
{
|
{
|
||||||
state: ['active'],
|
state: ['active'],
|
||||||
directives: {
|
directives: {
|
||||||
background: '$mod(--bg, 5)',
|
background: '$mod(--bg, 10)',
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
state: ['active', 'hover'],
|
||||||
|
directives: {
|
||||||
|
background: '$mod(--bg, 15)',
|
||||||
opacity: 1
|
opacity: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Text',
|
component: 'Text',
|
||||||
variant: 'normal',
|
|
||||||
parent: {
|
parent: {
|
||||||
component: 'MenuItem',
|
component: 'MenuItem',
|
||||||
state: ['normal', 'hover'],
|
state: ['hover']
|
||||||
variant: 'normal'
|
},
|
||||||
|
directives: {
|
||||||
|
textColor: '--link',
|
||||||
|
textAuto: 'no-preserve'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Text',
|
||||||
|
parent: {
|
||||||
|
component: 'MenuItem',
|
||||||
|
state: ['active']
|
||||||
|
},
|
||||||
|
directives: {
|
||||||
|
textColor: '--link',
|
||||||
|
textAuto: 'no-preserve'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Icon',
|
||||||
|
parent: {
|
||||||
|
component: 'MenuItem',
|
||||||
|
state: ['active']
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
textColor: '--link',
|
textColor: '--link',
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
:is="routeTo ? 'a' : 'button'"
|
:is="routeTo ? 'a' : 'button'"
|
||||||
class="main-link button-unstyled"
|
class="main-link"
|
||||||
:href="href"
|
:href="href"
|
||||||
@click="navigate"
|
@click="navigate"
|
||||||
>
|
>
|
||||||
|
@ -84,11 +84,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-link {
|
.main-link {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
display: inline;
|
||||||
|
text-align: initial;
|
||||||
|
font-size: 100%;
|
||||||
|
font-family: inherit;
|
||||||
|
line-height: unset;
|
||||||
|
cursor: pointer;
|
||||||
|
box-sizing: content-box;
|
||||||
|
color: var(--text);
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0 1em;
|
padding: 0 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-icon {
|
.menu-icon {
|
||||||
|
color: var(--icon);
|
||||||
margin-right: 0.8em;
|
margin-right: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -514,6 +514,7 @@ export default {
|
||||||
this.$store.dispatch('setOption', {
|
this.$store.dispatch('setOption', {
|
||||||
name: 'customTheme',
|
name: 'customTheme',
|
||||||
value: {
|
value: {
|
||||||
|
themeFileVersion: this.selectedVersion,
|
||||||
themeEngineVersion: CURRENT_VERSION,
|
themeEngineVersion: CURRENT_VERSION,
|
||||||
...this.previewTheme
|
...this.previewTheme
|
||||||
}
|
}
|
||||||
|
@ -521,6 +522,7 @@ export default {
|
||||||
this.$store.dispatch('setOption', {
|
this.$store.dispatch('setOption', {
|
||||||
name: 'customThemeSource',
|
name: 'customThemeSource',
|
||||||
value: {
|
value: {
|
||||||
|
themeFileVersion: this.selectedVersion,
|
||||||
themeEngineVersion: CURRENT_VERSION,
|
themeEngineVersion: CURRENT_VERSION,
|
||||||
shadows: this.shadowsLocal,
|
shadows: this.shadowsLocal,
|
||||||
fonts: this.fontsLocal,
|
fonts: this.fontsLocal,
|
||||||
|
|
|
@ -8,11 +8,11 @@ import { chunk } from 'lodash'
|
||||||
|
|
||||||
export const applyTheme = async (input) => {
|
export const applyTheme = async (input) => {
|
||||||
let extraRules
|
let extraRules
|
||||||
if (input.themeType !== 1) {
|
if (input.themeFileVersion === 1) {
|
||||||
|
extraRules = convertTheme2To3(input)
|
||||||
|
} else {
|
||||||
const { theme } = generatePreset(input)
|
const { theme } = generatePreset(input)
|
||||||
extraRules = convertTheme2To3(theme)
|
extraRules = convertTheme2To3(theme)
|
||||||
} else {
|
|
||||||
extraRules = convertTheme2To3(input)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const themes3 = init(extraRules, '#FFFFFF')
|
const themes3 = init(extraRules, '#FFFFFF')
|
||||||
|
@ -125,7 +125,7 @@ export const getPreset = (val) => {
|
||||||
.then((themes) => themes[val] ? themes[val] : themes['pleroma-dark'])
|
.then((themes) => themes[val] ? themes[val] : themes['pleroma-dark'])
|
||||||
.then((theme) => {
|
.then((theme) => {
|
||||||
const isV1 = Array.isArray(theme)
|
const isV1 = Array.isArray(theme)
|
||||||
const data = isV1 ? { themeType: 1 } : theme.theme
|
const data = isV1 ? {} : theme.theme
|
||||||
|
|
||||||
if (isV1) {
|
if (isV1) {
|
||||||
const bg = hex2rgb(theme[1])
|
const bg = hex2rgb(theme[1])
|
||||||
|
|
|
@ -155,7 +155,7 @@ export const getCssRules = (rules) => rules.map(rule => {
|
||||||
return [
|
return [
|
||||||
header,
|
header,
|
||||||
directives + ';',
|
directives + ';',
|
||||||
(!rule.virtual && rule.directives.textNoCssColor !== 'yes') ? ' color: var(--text);' : '',
|
(rule.component === 'Text' && rule.directives.textNoCssColor !== 'yes') ? ' color: var(--text);' : '',
|
||||||
'',
|
'',
|
||||||
virtualDirectives,
|
virtualDirectives,
|
||||||
footer
|
footer
|
||||||
|
|
|
@ -275,8 +275,12 @@ export const init = (extraRuleset, ultimateBackgroundColor) => {
|
||||||
selector: cssSelector.split(/ /g).slice(0, -1).join(' '),
|
selector: cssSelector.split(/ /g).slice(0, -1).join(' '),
|
||||||
...combination,
|
...combination,
|
||||||
directives: {},
|
directives: {},
|
||||||
virtualDirectives,
|
virtualDirectives: {
|
||||||
virtualDirectivesRaw
|
[virtualName]: getTextColorAlpha(newTextRule.directives, textColor, dynamicVars)
|
||||||
|
},
|
||||||
|
virtualDirectivesRaw: {
|
||||||
|
[virtualName]: textColor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
computed[selector] = computed[selector] || {}
|
computed[selector] = computed[selector] || {}
|
||||||
|
|
Loading…
Reference in New Issue