Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
CSS
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Sep 2014 at 16:41 UTC
Updated:
9 Feb 2015 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerNo idea what this means but +1 for making things consistent and good looking out of the box.
Comment #2
msankhala commentedWe can do simply like
By doing this we will not have to change the code where ever we using the
.form-itemclass under.views-exposed-formand useltr-inline-itemandrtl-inline-itemclass where we want inline item left to right and right to left respectively.Comment #3
msankhala commentedAdding patch.
Comment #4
lewisnymanBut then to create this visual you'll have to add this class to every form item in the form? It feels a lot easier just to add one class to the wrapper like we do with
container-inlineComment #5
alvar0hurtad0I'm going to add the class :D
Comment #6
alvar0hurtad0Thank you so much tu @rteijeiro for helping me.
Comment #7
alvar0hurtad0Sorry for uploading twice the patch...
Comment #8
lewisnymanThanks for the patch. I think it's possible to use the container-inline class here so I'm not against it. I'm not sure if this is the right approach as this will add the container-inline to all form elements, we want to add it to only the views exposed filter form. We should be able to delete all the CSS for the views exposed filter form and it could look the same.
Comment #9
alvar0hurtad0As i'm not really sure what does the previous comment means I prefer release the issue. If I can understand better comment #8I'll try to afford the patch.
Comment #10
lewisnymanSorry I'll emphasise the important part:
Comment #11
alvar0hurtad0Ok, I think I got it.
Thank You so much for be so patiente.
:D
Comment #12
lewisnymanOk, awesome. This looks like the right direction. Now, we should be able to delete all the CSS in views.exposed_form.css and it should look the same as before. I'm not sure that' will happen right now.
Comment #13
alvar0hurtad0It's probably a bit brave, but It's the best solution I could find.
As margins don't affect to inline elements, the form was too much close to the view content:

So I was looking for any reusable class that adds vertical margins to the wrapper. I couldn't find it so I created one at core/modules/system/css/system.module.css
To be honest I'm not really sure if it's the best name for the class and if it's a good idea define new classes at system.module.css.
Comment #16
lewisnymanAha that's true but if we get #2226317: Divs in the container-inline wrapper should be inline-block instead of inline in first then it should look a lot better?
Comment #18
alvar0hurtad0Yes, if We use inline-block it looks better, but there is not a "inline-block-container" class (almost I didn't find it).
Comment #19
lewisnymanNot yet, but once #2226317: Divs in the container-inline wrapper should be inline-block instead of inline is in then container-inline will be inline-block
Comment #20
alvar0hurtad0Awesome!!!
After applying the patch on #2226317: Divs in the container-inline wrapper should be inline-block instead of inline and the patch on this comment, the form looks like this:
Comment #21
alvar0hurtad0Sorry,
my previous patch has a mistake.
Comment #24
alvar0hurtad0Trying to pass the test, I think now the views.libraries.yml is ok.
Comment #25
lewisnymanPostponed on #2226317: Divs in the container-inline wrapper should be inline-block instead of inline
Comment #26
amateescu commentedLewis point me to this issue while we were discussing #1963340: Change field UI so that adding a field is a separate task. The current patch there copies the CSS from views exposed filters and would benefit a lot from the reusable class introduced here :)
Comment #27
lewisnymanNow that #2226317: Divs in the container-inline wrapper should be inline-block instead of inline is a no go for 8.0.x, we should really add a new class that can handle this well. I think it's ok to have classes that are really generic rather than try to do too much with one class.
Let's move back in the direction of the issue summary.
Comment #28
lewisnymanHere's a patch that replaces the
.views-exposed-formCSS with.form--inlineComment #29
amateescu commentedI realize this problem already exists, but the inlined form items look really crammed into each other. Should we increase the margin-right spacing a bit to 0.5em? I used 1em in #1963340: Change field UI so that adding a field is a separate task but that's because I have an element in between which contains only text (actually, two letters) so it might be too much for the default.
Comment #30
alvar0hurtad0Patch #28 works fine this patch adds also the margin sugested by #29
Comment #31
amateescu commentedAssuming that everyone agrees with the 0.5em spacing, I think this is ready.
Comment #32
alexpottCan we get a screenshot to compare the .25em with the .5em.
Also
Is still in template_preprocess_views_exposed_form() even though the library does not exist with this patch.
Comment #33
lewisnymanThanks Alex, looks like a novice task.
Comment #34
alexpottThis issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary. This will be allowed because it is in the unfrozen category (CSS).
Comment #35
alvar0hurtad0Here are the screenshots and the patch rerolled and with the #32 modification.
margin right 0.25em
margin right 0.5em
Comment #36
amateescu commentedThe new 0.5em spacing looks better to me but I'll let @LewisNyman make the final call :)
Comment #37
lewisnymanI like it! I'm glad we can polish this kind of stuff and other developers can just reuse it :). I've added the beta evaluation to the summary.
Comment #44
lewisnymanBack to RTBC
Comment #45
idebr commentedIt seems this change got lost along the way. The library declaration for
views/views.exposed-form.cssis deleted in views.libraries.yml, but the file is still there.Also, there is an issue about the css for exposed filters in the Views preview section that overlaps with this patch and should probably be merged: #2396465: Views UI: Exposed Filter css is not applied
Comment #46
alexpottCan someone test that we've not broken #2396465: Views UI: Exposed Filter css is not applied now that that has landed :)
Comment #47
amateescu commentedFurther to #46, #1963340: Change field UI so that adding a field is a separate task landed some time ago so the patch needs to be updated to make FieldStorageAddForm use this new styling class.
Comment #48
idebr commented@amateescu Thanks for the heads up, I updated the 'Field: add field' form with the new
form--inlineclass.I have added some screenshots in the attachments. For the sake of brevity I have not embedded them in the comment.
Comment #49
lewisnymanGreat work! Thanks for all the screenshots. I think we're good to go here.
Comment #50
amateescu commentedIt looks perfect! RTBC++
Comment #51
alexpottCommitted c741d42 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.