Refactor styling of nested content lists
This commit is contained in:
parent
88409a6268
commit
50cb811f05
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
:class="{'hideable-element--greyed-out': hidden}"
|
:class="{'hideable-element--greyed-out': hidden}"
|
||||||
class="content-block__container hideable-element">
|
class="content-block__container hideable-element content-list__parent">
|
||||||
<div
|
<div
|
||||||
:class="specialClass"
|
:class="specialClass"
|
||||||
class="content-block">
|
class="content-block">
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="content-list__item"
|
class="content-list__item"
|
||||||
v-for="(item, index) in items">
|
v-for="(item, index) in items">
|
||||||
<p class="content-list__numbering">{{ alphaIndex(index) }})</p>
|
|
||||||
<slot
|
<slot
|
||||||
:item="item"
|
:item="item"
|
||||||
:index="index">
|
:index="index">
|
||||||
|
|
@ -15,29 +14,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const lowerAsciiA = 97;
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//
|
//
|
||||||
props: {
|
props: {
|
||||||
startingIndex: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ([])
|
default: () => ([])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
alphaIndex(index) {
|
|
||||||
return String.fromCharCode(lowerAsciiA + this.startingIndex + index);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import '~styles/helpers';
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="create-content-block">
|
<div class="create-content-block content-list__parent">
|
||||||
<div class="create-content-block__content">
|
<div class="create-content-block__content">
|
||||||
<h1 class="heading-1 create-content-block__heading">Inhaltsblock erfassen</h1>
|
<h1 class="heading-1 create-content-block__heading">Inhaltsblock erfassen</h1>
|
||||||
|
|
||||||
|
|
@ -83,7 +83,6 @@
|
||||||
import TextForm from '@/components/content-forms/TextForm';
|
import TextForm from '@/components/content-forms/TextForm';
|
||||||
import InputWithLabel from '@/components/ui/InputWithLabel';
|
import InputWithLabel from '@/components/ui/InputWithLabel';
|
||||||
import AddContentLink from '@/components/content-block-form/AddContentLink';
|
import AddContentLink from '@/components/content-block-form/AddContentLink';
|
||||||
import ContentList from '@/components/content-blocks/ContentList';
|
|
||||||
import ContentBlockElementChooserWidget from '@/components/content-forms/ContentBlockElementChooserWidget';
|
import ContentBlockElementChooserWidget from '@/components/content-forms/ContentBlockElementChooserWidget';
|
||||||
import ContentElement from '@/components/content-block-form/ContentElement';
|
import ContentElement from '@/components/content-block-form/ContentElement';
|
||||||
|
|
||||||
|
|
@ -91,7 +90,6 @@
|
||||||
components: {
|
components: {
|
||||||
ContentElement,
|
ContentElement,
|
||||||
ContentBlockElementChooserWidget,
|
ContentBlockElementChooserWidget,
|
||||||
ContentList,
|
|
||||||
AddContentLink,
|
AddContentLink,
|
||||||
InputWithLabel,
|
InputWithLabel,
|
||||||
TextForm,
|
TextForm,
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,24 @@
|
||||||
.content-list {
|
.content-list {
|
||||||
/* https://stackoverflow.com/questions/1632005/ordered-list-html-lower-alpha-with-right-parentheses */
|
/* https://stackoverflow.com/questions/1632005/ordered-list-html-lower-alpha-with-right-parentheses */
|
||||||
|
|
||||||
|
// parent element needs to reset the counter-increment
|
||||||
|
// either use this class, or use the attribute on it
|
||||||
|
&__parent {
|
||||||
|
counter-reset: content-items;
|
||||||
|
}
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 0 0 2*15px;
|
padding: 0 0 0 2*15px;
|
||||||
}
|
&:before {
|
||||||
|
content: counter(content-items, lower-alpha) ")";
|
||||||
&__numbering {
|
counter-increment: content-items;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
left: 0;
|
left: 0;
|
||||||
color: $color-brand;
|
color: $color-brand;
|
||||||
line-height: 27px;
|
line-height: 27px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue