-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6430 from getkirby/fix/6378-blocks-img-pattern
Image blocks: add pattern background
- Loading branch information
Showing
12 changed files
with
252 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
panel/src/components/Forms/Blocks/Elements/BlockBackgroundDropdown.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<div class="k-block-background-dropdown"> | ||
<k-button | ||
:dropdown="true" | ||
size="xs" | ||
variant="filled" | ||
@click="$refs.dropdown.toggle()" | ||
> | ||
<k-color-frame :color="value" ratio="1/1" /> | ||
</k-button> | ||
<k-dropdown-content | ||
ref="dropdown" | ||
align-x="end" | ||
:options="[ | ||
{ | ||
text: $t('field.blocks.figure.back.plain'), | ||
click: 'var(--color-white)' | ||
}, | ||
{ | ||
text: $t('field.blocks.figure.back.pattern.light'), | ||
click: 'var(--pattern-light)' | ||
}, | ||
{ | ||
text: $t('field.blocks.figure.back.pattern.dark'), | ||
click: 'var(--pattern)' | ||
} | ||
]" | ||
@action="$emit('input', $event)" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
value: String | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
.k-block-background-dropdown > .k-button { | ||
--color-frame-rounded: 0; | ||
--color-frame-size: 1.5rem; | ||
--button-height: 1.5rem; | ||
--button-padding: 0 0.125rem; | ||
--button-color-back: var(--color-white); | ||
gap: 0.25rem; | ||
box-shadow: var(--shadow-toolbar); | ||
border: 1px solid var(--color-white); | ||
} | ||
.k-block-background-dropdown .k-color-frame { | ||
border-right: 1px solid var(--color-gray-300); | ||
} | ||
.k-block-background-dropdown .k-color-frame::after { | ||
box-shadow: none; | ||
} | ||
.k-block .k-block-background-dropdown { | ||
position: absolute; | ||
inset-inline-end: var(--spacing-3); | ||
bottom: var(--spacing-3); | ||
opacity: 0; | ||
transition: opacity 0.2s ease-in-out; | ||
} | ||
.k-block:hover .k-block-background-dropdown { | ||
opacity: 1; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
panel/src/components/Forms/Blocks/Elements/BlockFigureCaption.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<figcaption class="k-block-figure-caption"> | ||
<k-writer | ||
:disabled="disabled" | ||
:inline="true" | ||
:marks="marks" | ||
:spellcheck="false" | ||
:value="value" | ||
@input="$emit('input', $event)" | ||
/> | ||
</figcaption> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
disabled: Boolean, | ||
marks: [Array, Boolean], | ||
value: String | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
.k-block-figure-caption { | ||
display: flex; | ||
justify-content: center; | ||
padding-top: var(--spacing-3); | ||
} | ||
.k-block-figure-caption .k-writer { | ||
width: max-content; | ||
text-align: center; | ||
} | ||
.k-block-figure-caption .k-writer .k-text { | ||
color: var(--color-gray-600); | ||
font-size: var(--text-sm); | ||
mix-blend-mode: exclusion; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.