Fix rendering of inline code blocks for docs
Styling of codeblocks:
- Uniform margins as other documentation elements.
- Add small margin for inline code-blocks.
- Use different background color for inline code-blocks.
- Introduce `inline-code` and `code-block` mixins for clarity in
styling.
Overflowing of codeblocks:
- Improve flex layout of the tree component to be handle overflowing
content and providing maximum available width. To be able to correctly
provide maximum available width in card content, card expansion layout
is changed so both close button and the content gets their full width.
- Other refactorings to support this:
- Introduce separate Vue component for checkboxes of nodes for better
separation of concerns and improved maintainability.
- Refactor `LeafTreeNode` to make it simpler, separating layout concerns
from other styling.
- `ScriptsTree.vue`: Prefer `<div>`s instead of `<span>`s as they
represent large content.
- Remove unnecessary `<div>`s and use `<template>`s to reduce HTML
complexity.
- Update script documentation to not include unnecessary left padding
on script code blocks.
- Refactor SCSS variable names in `DocumentationText.vue` for clarity.
This commit is contained in:
@@ -30,15 +30,15 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="card__expander" @click.stop>
|
||||
<div class="card__expander__content">
|
||||
<ScriptsTree :category-id="categoryId" />
|
||||
</div>
|
||||
<div class="card__expander__close-button">
|
||||
<AppIcon
|
||||
icon="xmark"
|
||||
@click="collapse()"
|
||||
/>
|
||||
</div>
|
||||
<div class="card__expander__content">
|
||||
<ScriptsTree :category-id="categoryId" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -184,20 +184,24 @@ $card-horizontal-gap : $card-gap;
|
||||
position: relative;
|
||||
background-color: $color-primary-darker;
|
||||
color: $color-on-primary;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
&__content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
word-break: break-word;
|
||||
margin-bottom: 1em;
|
||||
margin-left: 0.5em;
|
||||
margin-right: 0.5em;
|
||||
max-width: 100%; // Prevents horizontal expansion of inner content (e.g., when a code block is shown)
|
||||
}
|
||||
|
||||
&__close-button {
|
||||
width: auto;
|
||||
font-size: 1.5em;
|
||||
align-self: flex-start;
|
||||
align-self: flex-end;
|
||||
margin-right: 0.25em;
|
||||
@include clickable;
|
||||
color: $color-primary-light;
|
||||
@@ -242,8 +246,6 @@ $card-horizontal-gap : $card-gap;
|
||||
|
||||
.card__expander {
|
||||
min-height: 200px;
|
||||
// max-height: 1000px;
|
||||
// overflow-y: auto;
|
||||
margin-top: $expanded-margin-top;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user