Remove file input ID, add margin to card
This commit is contained in:
parent
6da83926a0
commit
291f567c8e
|
@ -133,6 +133,7 @@ body {
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,.3);
|
box-shadow: 0 1px 3px rgba(0,0,0,.3);
|
||||||
border: 1px solid $border-light;
|
border: 1px solid $border-light;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
|
||||||
&.toolkit-dark {
|
&.toolkit-dark {
|
||||||
background-color: $dark-body;
|
background-color: $dark-body;
|
||||||
|
|
|
@ -4,7 +4,6 @@ use crate::ButtonKind;
|
||||||
pub struct FileInput {
|
pub struct FileInput {
|
||||||
pub(crate) name: String,
|
pub(crate) name: String,
|
||||||
pub(crate) label: String,
|
pub(crate) label: String,
|
||||||
pub(crate) id: String,
|
|
||||||
pub(crate) kind: ButtonKind,
|
pub(crate) kind: ButtonKind,
|
||||||
pub(crate) accept: String,
|
pub(crate) accept: String,
|
||||||
pub(crate) classes: Vec<String>,
|
pub(crate) classes: Vec<String>,
|
||||||
|
@ -14,43 +13,39 @@ pub struct FileInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileInput {
|
impl FileInput {
|
||||||
pub fn primary(name: &str, label: &str, id: &str) -> Self {
|
pub fn primary(name: &str, label: &str) -> Self {
|
||||||
FileInput {
|
FileInput {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
label: label.to_owned(),
|
label: label.to_owned(),
|
||||||
id: id.to_owned(),
|
|
||||||
group: true,
|
group: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn primary_outline(name: &str, label: &str, id: &str) -> Self {
|
pub fn primary_outline(name: &str, label: &str) -> Self {
|
||||||
FileInput {
|
FileInput {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
label: label.to_owned(),
|
label: label.to_owned(),
|
||||||
id: id.to_owned(),
|
|
||||||
kind: ButtonKind::PrimaryOutline,
|
kind: ButtonKind::PrimaryOutline,
|
||||||
group: true,
|
group: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn outline(name: &str, label: &str, id: &str) -> Self {
|
pub fn outline(name: &str, label: &str) -> Self {
|
||||||
FileInput {
|
FileInput {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
label: label.to_owned(),
|
label: label.to_owned(),
|
||||||
id: id.to_owned(),
|
|
||||||
kind: ButtonKind::Outline,
|
kind: ButtonKind::Outline,
|
||||||
group: true,
|
group: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn secondary(name: &str, label: &str, id: &str) -> Self {
|
pub fn secondary(name: &str, label: &str) -> Self {
|
||||||
FileInput {
|
FileInput {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
label: label.to_owned(),
|
label: label.to_owned(),
|
||||||
id: id.to_owned(),
|
|
||||||
kind: ButtonKind::Secondary,
|
kind: ButtonKind::Secondary,
|
||||||
group: true,
|
group: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@if file.group {
|
@if file.group {
|
||||||
<div class="toolkit-button-group">
|
<div class="toolkit-button-group">
|
||||||
<div class="@file.class_string()">
|
<div class="@file.class_string()">
|
||||||
<span id="@file.id">@file.label</span>
|
<span>@file.label</span>
|
||||||
@if file.multiple {
|
@if file.multiple {
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
} else {
|
} else {
|
||||||
<div class="@file.class_string()">
|
<div class="@file.class_string()">
|
||||||
<span id="@file.id">@file.label</span>
|
<span>@file.label</span>
|
||||||
@if file.multiple {
|
@if file.multiple {
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
|
Loading…
Reference in a new issue