fix: Button styling updates

This commit is contained in:
Emilia Allison 2024-08-09 22:35:00 -04:00
parent 9e1abdc8bb
commit 52b28aabb1
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
4 changed files with 49 additions and 26 deletions

View File

@ -0,0 +1,27 @@
@use "sass:color";
@use "./variables" as *;
$selection-border-width: 2px;
@mixin standard_button {
color: inherit;
display: inline;
margin-left: 3px;
border: 2px solid rgba(1,1,1,0.2);
background: transparent;
user-select: none;
list-style: none;
line-height: 1em;
&::before {
text-align: center;
vertical-align: middle;
}
&:hover {
background: color.change($color-light, $alpha: 0.08);
transition: background 0.1s;
border: $selection-border-width solid color.change($color-light, $alpha:0.3);
}
}

View File

@ -1,5 +1,6 @@
@use "sass:color"; @use "sass:color";
@use "../variables" as *; @use "../variables" as *;
@use "../button" as *;
div.transfer_menu { div.transfer_menu {
position: relative; position: relative;
@ -40,6 +41,11 @@ div.transfer_menu {
} }
} }
div.transfer_menu input[type="button"] {
@include standard_button;
}
input { input {
text-align: center; text-align: center;
margin-left: 0.5em; margin-left: 0.5em;
@ -50,7 +56,7 @@ input {
padding: 0; padding: 0;
&[type="text"] { &[type="text"] {
width: 4em; width: 6em;
} }
&[name="name"] { &[name="name"] {
width: calc(100% - 6em); // Override above width: calc(100% - 6em); // Override above

View File

@ -1,5 +1,6 @@
@use "sass:color"; @use "sass:color";
@use "../variables" as *; @use "../variables" as *;
@use "../button" as *;
$selection-border-width: 2px; $selection-border-width: 2px;
@ -54,29 +55,16 @@ div.tree li {
} }
} }
div.tree--header {
margin-top: 1%;
display: flex;
align-items: center;
}
div.tree button { div.tree button {
position: relative; @include standard_button;
top: -0.15em;
display: inline;
margin-left: 0;
margin-bottom: 0.4rem;
border: 2px solid transparent;
background: transparent;
user-select: none;
list-style: none;
line-height: 1em;
aspect-ratio: 1;
&::before { &::before {
text-align: center; content: "Add";
vertical-align: middle;
content: "+"; // Nicer X
}
&:hover {
background: rgba(1,1,1,0.1);
transition: background 0.1s;
} }
} }

View File

@ -99,23 +99,25 @@ pub fn Tree(props: &TreeProps) -> Html {
html! { html! {
<div class="tree"> <div class="tree">
<div id="source-plates"> <div id="source-plates">
<h3>{"Source Plates:"} <div class="tree--header">
<h3>{"Source Plates:"}</h3>
<button onclick={ <button onclick={
let open_new_plate_callback = props.open_new_plate_callback.clone(); let open_new_plate_callback = props.open_new_plate_callback.clone();
move |_| {open_new_plate_callback.emit(NewPlateDialogType::SourceOnly)} move |_| {open_new_plate_callback.emit(NewPlateDialogType::SourceOnly)}
} /> } />
</h3> </div>
<ul> <ul>
{source_plates} {source_plates}
</ul> </ul>
</div> </div>
<div id="destination-plates"> <div id="destination-plates">
<h3>{"Destination Plates:"} <div class="tree--header">
<h3>{"Destination Plates:"}</h3>
<button onclick={ <button onclick={
let open_new_plate_callback = props.open_new_plate_callback.clone(); let open_new_plate_callback = props.open_new_plate_callback.clone();
move |_| {open_new_plate_callback.emit(NewPlateDialogType::DestinationOnly)} move |_| {open_new_plate_callback.emit(NewPlateDialogType::DestinationOnly)}
} /> } />
</h3> </div>
<ul> <ul>
{dest_plates} {dest_plates}
</ul> </ul>