🎨 Adds section-specific class names (#769)

This commit is contained in:
Lissy93 2022-07-02 22:28:09 +01:00
parent 113f31a93a
commit 4210c985b7
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@
<div
v-bind:class="[
{ 'is-open': isExpanded, 'full-height': cutToHeight },
`collapsable ${rowColSpanClass}`
`collapsable ${rowColSpanClass}`, sectionClassName
]"
:style="`${color ? 'background: '+color : ''}; ${sanitizeCustomStyles(customStyles)};`"
>
@ -74,6 +74,10 @@ export default {
const { rows, cols, checkSpanNum } = this;
return `${checkSpanNum(cols, 'col')} ${checkSpanNum(rows, 'row')}`;
},
sectionClassName() {
if (!this.title) return 'unnamed-section';
return `section_${this.title.replaceAll(' ', '-').toLowerCase()}`;
},
/* Used to fetch initial collapse state, and set new collapse state on change */
isExpanded: {
get() {