Skip to content

Commit

Permalink
fix(admin): Fix margins for switch and file inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaskill committed Mar 11, 2024
1 parent 8eb96cb commit e582431
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/admin/assets/dist/styles/charcoal.admin.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $switch-transition: .2s all !default;
+ label {
position: relative;
min-width: calc(#{$switch-height} * 2);
margin-bottom: 0;
border-radius: $switch-border-radius;
height: $switch-height;
line-height: $switch-height;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// ==========================================================================

// Focus for file, radio, and checkbox
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
// outline: none;
}
// input[type="file"]:focus,
// input[type="radio"]:focus,
// input[type="checkbox"]:focus {
// outline: none;
// }

input[type="url"] {
// @see https://github.com/necolas/normalize.css/issues/519#issuecomment-197131966
Expand Down Expand Up @@ -120,6 +120,13 @@ label {
}
}

.form-file-group {
& + .preview-file {
margin-top: 1em;
margin-bottom: 0;
}
}

.active-lang {
[data-lang] {
color: $charcoal-gray-3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
--}}
{{! charcoal/admin/property/input/file/control }}
<div id="{{ inputId }}">
<div class="form-group" >
<div class="form-file-group" >
{{# showFileUpload }}
<input
type="file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
`charcoal/admin/property/input/file`
--}}
<div class="form-group">
<div class="form-file-group">
<input type="hidden" name="{{ inputName }}" value="{{ inputVal }}">
{{# showFileUpload }}
<input
Expand All @@ -23,4 +23,4 @@
{{^ showFilePreview }}
<button type="button" class="btn btn-link js-remove-file hide-if-no-file{{^ inputVal }} d-none{{/ inputVal }}">{{ removeButtonLabel }}</button>
{{/ showFilePreview }}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
--}}
{{# showFilePreview }}
{{# placeholder }}
<figure class="img-thumbnail show-if-no-file{{# inputVal }} d-none{{/ inputVal }}">
<figure class="preview-file img-thumbnail show-if-no-file{{# inputVal }} d-none{{/ inputVal }}">
<div>
<img src="{{& placeholderVal }}" style="max-width: 100%; opacity: 0.5">
</div>
Expand All @@ -17,5 +17,4 @@
</figcaption>
</figure>
{{/ placeholder }}
{{/ showFilePreview }}

{{/ showFilePreview }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`charcoal/admin/property/input/file`
--}}
{{# showFilePreview }}
<figure class="figure img-thumbnail hide-if-no-file{{^ inputVal }} d-none{{/ inputVal }}">
<figure class="preview-file figure img-thumbnail hide-if-no-file{{^ inputVal }} d-none{{/ inputVal }}">
<div class="js-preview-file">{{& filePreview }}</div>
<figcaption class="figure-caption p-1">
<p class="u-truncate">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
type="hidden"
name="{{ inputName }}"
>
<div class="form-group">
<span class="switch switch-lg{{# inputClass }} {{ . }}{{/ inputClass }}">
<input
class="switch"
type="checkbox"
id="{{ inputId }}"
name="{{ inputName }}"
{{# checked }}checked{{/ checked }}
{{# readOnly }}readonly{{/ readOnly }}
{{# required }}required{{/ required }}
{{# disabled }}disabled{{/ disabled }}>
<label for="{{ inputId }}"><span class="sr-only">{{# _t }}Toggle Value{{/ _t }}</span></label>
</span>
</div>
<span class="switch switch-lg{{# inputClass }} {{ . }}{{/ inputClass }}">
<input
class="switch"
type="checkbox"
id="{{ inputId }}"
name="{{ inputName }}"
{{# checked }}checked{{/ checked }}
{{# readOnly }}readonly{{/ readOnly }}
{{# required }}required{{/ required }}
{{# disabled }}disabled{{/ disabled }}>
<label for="{{ inputId }}"><span class="sr-only">{{# _t }}Toggle Value{{/ _t }}</span></label>
</span>

0 comments on commit e582431

Please sign in to comment.