More flexible bleeds in tekst and subtree

This commit is contained in:
Kuba Orlik 2026-08-19 22:22:57 +02:00
parent dde87bd086
commit cffeb98914
3 changed files with 20 additions and 1 deletions

View File

@ -115,3 +115,12 @@
} }
} }
} }
.grid-layout-main > .subtree:not(.subtree--bleed-none) {
display: grid !important;
grid-template-columns: subgrid;
& > * {
grid-column: content;
}
}

View File

@ -11,6 +11,14 @@
font-size: 20px; font-size: 20px;
} }
&.tekst--bleed-none {
grid-column: content !important;
}
&.tekst--bleed-bleed {
grid-column: bleed !important;
}
p { p {
margin: 0; margin: 0;
} }

View File

@ -17,6 +17,7 @@ const component_arguments = {
size: new ComponentArguments.Enum(["small", "normal", "large"]).setDefaultValue( size: new ComponentArguments.Enum(["small", "normal", "large"]).setDefaultValue(
"normal" "normal"
), ),
bleed: new ComponentArguments.Enum(["none", "bleed"]).setDefaultValue("none"),
content: new ComponentArguments.Markdown(), content: new ComponentArguments.Markdown(),
side_content: new ComponentArguments.NestedComponent(), side_content: new ComponentArguments.NestedComponent(),
} as const; } as const;
@ -42,7 +43,7 @@ export class Tekst extends Component<typeof component_arguments> {
} }
toHTML({ toHTML({
args: { color, content, side_content, size }, args: { color, content, side_content, size, bleed },
classes, classes,
jdd_context, jdd_context,
index, index,
@ -55,6 +56,7 @@ export class Tekst extends Component<typeof component_arguments> {
...classes, ...classes,
`tekst--color-${color}`, `tekst--color-${color}`,
`tekst--size-${size}`, `tekst--size-${size}`,
`tekst--bleed-${bleed}`,
]} ]}
style={`--jdd-index: ${index}`} style={`--jdd-index: ${index}`}
> >