Skip to content

Commit

Permalink
Add margin to cards in static field output
Browse files Browse the repository at this point in the history
This reverts commit d0fe364.
  • Loading branch information
brandonkelly committed Feb 6, 2024
1 parent 08be879 commit aaaeed1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ public function getCardHtml(ElementInterface $entry): string
'showDraftName' => !$isRevision,
'showStatus' => !$isRevision,
'showThumb' => !$isRevision,
'attributes' => [
'class' => array_filter([$isRevision ? 'cke-entry-card' : null]),
],
]);
}

Expand Down Expand Up @@ -824,6 +827,8 @@ protected function inputHtml(mixed $value, ?ElementInterface $element, $inline):
*/
public function getStaticHtml(mixed $value, ElementInterface $element): string
{
Craft::$app->getView()->registerAssetBundle(CkeditorAsset::class);

return Html::tag(
'div',
$this->prepValueForInput($value, $element, true) ?: ' ',
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/ckeditor/dist/css/ckeditor5-craftcms.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/web/assets/ckeditor/src/ckeditor5-craftcms.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ a.ck.ck-button:focus {
background: var(--ck-color-base-background);
}

.ck-content .cke-entry-card {
.cke-entry-card {
margin: 0.9em auto; /* same as images */
border-radius: var(--large-border-radius);
}
Expand Down

0 comments on commit aaaeed1

Please sign in to comment.