-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove margin between file input field and link #33
Conversation
@dontub can you show the relevant part of the DOM (e.g. screenshot)? Maybe using |
The resulting HTML is like this: <div class="js-form-item form-item custom-control custom-file js-form-type-file form-type-file js-form-item-files-foo form-item-files-foo">
<label for="edit-foo" class="custom-control-label">Foo</label>
<div class="wrapper-input-file">
<input data-drupal-selector="edit-foo" type="file" id="edit-foo" name="files[foo]" size="60" class="js-form-file form-file">
<label for="file">Choose a file</label>
</div>
</div>
<p class="civiremote-form-file-link">
<a href="url/to/foo.txt" target="_blank" data-drupal-selector="edit-link" id="edit-link">foo.txt</a>
</p> The element of type |
I thought of placing the link as |
The file input field is wrapped by a `div` with class `.form-item` and thus gets a bottom margin. The `p` element containing the link to the current file has a top margin. So there is a lot of space between input field and link. This change sets these margins to `0`.
e56341a
to
3a40208
Compare
Yet, it would be preferable if the link would be inside the form element wrapper. |
I think the "proper" thing to do would be creating a new render element, containing and processing both elements (the file upload field and a link element for the current file). Not sure however whether it's worth the effort only for a margin … |
I've created an issue for this #40 and I'll merge this now. |
The file input field is wrapped by a
div
with class.form-item
and thus gets a bottom margin. Thep
element containing the link to the current file has a top margin. So there is a lot of space between input field and link. This change sets these margins to0
.systopia-reference: 25904