Merge branch 'fix-shadows-everywhere' into 'develop'
add 'none' keyword to PISS shadow definiton that equals empty array See merge request pleroma/pleroma-fe!1946
This commit is contained in:
commit
cf24e30095
0
changelog.d/piss-fix.skip
Normal file
0
changelog.d/piss-fix.skip
Normal file
|
@ -16,7 +16,8 @@ export default {
|
|||
{
|
||||
directives: {
|
||||
background: '#ffffff',
|
||||
opacity: 0
|
||||
opacity: 0,
|
||||
shadow: []
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -16,7 +16,8 @@ export default {
|
|||
component: 'PanelHeader',
|
||||
directives: {
|
||||
backgroundNoCssColor: 'yes',
|
||||
background: '--fg'
|
||||
background: '--fg',
|
||||
shadow: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -138,7 +138,11 @@ export const deserialize = (input) => {
|
|||
const [property, value] = d.split(':')
|
||||
let realValue = value.trim()
|
||||
if (property === 'shadow') {
|
||||
if (realValue === 'none') {
|
||||
realValue = []
|
||||
} else {
|
||||
realValue = value.split(',').map(v => parseShadow(v.trim()))
|
||||
}
|
||||
} if (!Number.isNaN(Number(value))) {
|
||||
realValue = Number(value)
|
||||
}
|
||||
|
|
|
@ -32,7 +32,11 @@ export const serialize = (ruleset) => {
|
|||
} else {
|
||||
switch (directive) {
|
||||
case 'shadow':
|
||||
if (value.length > 0) {
|
||||
return ` ${directive}: ${value.map(serializeShadow).join(', ')}`
|
||||
} else {
|
||||
return ` ${directive}: none`
|
||||
}
|
||||
default:
|
||||
return ` ${directive}: ${value}`
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ describe('ISS (de)serialization', () => {
|
|||
/*
|
||||
// Debug snippet
|
||||
const onlyComponent = componentsContext('./components/panel_header.style.js').default
|
||||
it(`(De)serialization of component ${onlyComponent.name} works`, () => {
|
||||
it.only(`(De)serialization of component ${onlyComponent.name} works`, () => {
|
||||
const normalized = onlyComponent.defaultRules.map(x => ({ component: onlyComponent.name, ...x }))
|
||||
console.log('BEGIN INPUT ================')
|
||||
console.log(normalized)
|
||||
|
@ -36,5 +36,5 @@ describe('ISS (de)serialization', () => {
|
|||
// for some reason comparing objects directly fails the assert
|
||||
expect(JSON.stringify(deserialized, null, 2)).to.equal(JSON.stringify(normalized, null, 2))
|
||||
})
|
||||
*/
|
||||
/* */
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue