AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
842 stars 315 forks source link

Add possibility to show an outline in preview if no tag is present #2744

Closed kulturbande closed 8 months ago

kulturbande commented 8 months ago

What is this pull request for?

Extend the element_view_for - method to show an outline to element, that has a disabled tag - option. It adds an unregistered custom component tag (which will have no visual representation except one display property), to make the element clickable and highlightable.

Screenshots

CleanShot 2024-02-25 at 15 25 30@2x CleanShot 2024-02-25 at 15 24 54@2x

Checklist

kulturbande commented 8 months ago

The biggest downside is, that it can break CSS selectors. For example:

.foo > details {}
<div class="foo">
  <alchemy-preview>
    <details>...</details>
  </alchemy-preview>
</div>

There is a possibility to set the alchemy-preview - tag to display: contents;, which would solve the selector - issue, but the outline wouldn't be visible anymore.

tvdeyen commented 8 months ago

Unfortunately we cannot do this because of the downside mentioned. Thanks, but closing for now