Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move element hint into header (again) #3096

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions app/stylesheets/alchemy/admin/elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,17 @@ alchemy-tinymce {
}

.element-title {
display: inline-flex;
align-items: center;
flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
transition: color vars.$transition-duration;
line-height: 1;
max-width: 85%;

.element-hidden > & {
max-width: 65%;
}

.preview_text_quote {
overflow: hidden;
text-overflow: ellipsis;
font-size: var(--font-size_small);
margin-left: var(--spacing-0);
}
Expand All @@ -99,6 +97,7 @@ alchemy-tinymce {
font-size: var(--font-size_small);
font-weight: bold;
line-height: 15px;
margin-right: var(--spacing-0);
}

.element-handle {
Expand Down Expand Up @@ -160,6 +159,14 @@ alchemy-tinymce {
> .element-header {
background-color: transparent;

.element-title {
max-width: 65%;
}

.element-toggle {
margin-left: var(--spacing-1);
}

.element-hidden-icon {
display: inline-flex;
align-items: center;
Expand Down
4 changes: 0 additions & 4 deletions app/views/alchemy/admin/elements/_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

<%= render 'alchemy/admin/elements/toolbar', element: element %>

<% if element.has_hint? %>
<%= render_message(:hint, sanitize(element.hint)) %>
<% end %>

<% element.definition[:message].tap do |message| %>
<%= render_message(:info, sanitize(message)) if message %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions app/views/alchemy/admin/elements/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</span>
<span class="element-title">
<span class="preview_text_element_name"><%= element.display_name %></span>
<%= render_hint_for(element, size: "1x", fixed_width: false) %>
<span class="preview_text_quote">
<%= sanitize(element.preview_text.presence || '&nbsp;') %>
</span>
Expand Down