Make command a button

This commit is contained in:
Jason Zimdars
2025-05-06 17:45:05 -05:00
parent 10890df97f
commit 94e2ab25f9
3 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -154,7 +154,7 @@
.btn--plain {
--btn-background: transparent;
--btn-border-radius: 0.5em;
--btn-border-radius: 0;
--btn-border-size: 0;
--btn-color: inherit;
--btn-icon-size: 100%;
+16
View File
@@ -54,6 +54,13 @@
white-space: nowrap;
}
.terminal__command {
--btn-background: transparent;
--btn-color: var(--color-terminal-text);
font-weight: normal;
}
.terminal__link {
--hover-size: 0;
@@ -69,6 +76,15 @@
}
}
.terminal__item {
@media (any-hover: hover) {
&:where(:not(:active):hover),
&:where(:not(:active)):focus-visible {
background: color-mix(in srgb, var(--color-terminal-text) 15%, var(--color-terminal-bg));
}
}
}
.has-error .terminal__input {
border: 2px solid red;
}
+3 -3
View File
@@ -1,7 +1,7 @@
<li class="min-width flex gap-half">
<span class="overflow-ellipsis"><%= command.title %></span>
<li class="min-width full-width flex gap-half terminal__item justify-start">
<button class="btn btn--plain overflow-ellipsis terminal__command flex-item-grow justify-start"><%= command.title %></button>
<% if command.undoable? %>
<%= button_to "Undo", command_undo_path(command), class: "btn btn--plain terminal__button", data: { turbo_confirm: "Are you sure you want to undo '#{command.title}'?", turbo_frame: "_top" } %>
<%= button_to "Undo", command_undo_path(command), class: "btn btn--plain terminal__button flex-item-justify-end", data: { turbo_confirm: "Are you sure you want to undo '#{command.title}'?", turbo_frame: "_top" } %>
<% end %>
</li>