Problem/Motivation
There are some situations where we which to group elements together on a page to emphasise the relationship between them. Using a fieldset is not always desirable to use it because it has an effect on screenreader users. We need to create a class that can be added to any element.
Proposed resolution
In the Seventy Eight issue it was suggested that we create an applicable class that can be applied to any elements, including a fieldset. The fieldset element has semantic value to screen reader users and the use of the tag it could be used for accessibility reasons only. There are also other elements across of Core that have similar styling applied that are not actually fieldsets.
The design of an open fieldset has been tweaked to match the principles of the new Seven Style Guide.
This styling was prototyped in the Seventy Eight sandbox.
Test Pages
- admin/structure/types/manage/article/fields/node.article.body
- admin/structure/views/view/content
- admin/structure/taxonomy/manage/tags/add
- admin/modules
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff.txt | 511 bytes | LewisNyman |
#14 | drupal8.views-exposed-fieldgroup.14.patch | 3.96 KB | LewisNyman |
Comments
Comment #1
LewisNymantag
Comment #2
LewisNymanAfter some exploration, it seems that there are actually very few fieldsets in core right now. They have have been converted into
<details>
elements. It's also entirely possible that fieldsets could be used for non visual reasons and that the visual grouping could be used in situations where a fieldset is not the appropriate tag. An example the demonstration given in the issue summary, the visual grouping is wrapping the entire form.I'm expanding this issue to introduce a reusable 'pane' component that can be used on any element — fieldset, details, etc — to visually group form items together. This might be a good opportunity to try out some good documentation on when this component should be used.
Comment #3
LewisNymanComment #4
nod_I think the term 'pane' will end up confusing people. I don't have better though.
Comment #5
LewisNymanLet's go for it and see what happens
Comment #6
LewisNymanBad patch!
Comment #7
mgifford6: seven-pane-2113903-6.patch queued for re-testing.
Comment #9
mgiffordGood place to test this (well along with #2002336: Introduce a CSS class to hide borders of fieldset elements ) - admin/config/development/performance
Comment #10
LewisNymanComment #11
sunI quickly whipped up a patch to demonstrate that #type 'fieldgroup' resolves the issue already (except of Seven-specific styling, of course):
This requires some changes to how Views constructs the exposed form. The changes in attached patch are just quick & dirty only, not meant to be an official change proposal.
As far as I can see, Views does not support a concept for a label/heading for the exposed form yet, so the "Filter" legend in this screenshot is hard-coded right now.
Perhaps @dawehner and other Views experts are able to help.
(Perhaps it might also be a good idea to split those Views changes into a separate issue, so that this issue stays focused on the Seven theme changes only...)
Comment #13
damiankloip CreditAttribution: damiankloip commentedThis patch just adds a configurable title to the field group to sun's patch. Also, changes 'filters' key to 'handlers'.
Do we want to split this into its own issue?
Comment #14
LewisNyman@damiankloip yes please. It's good to provide an example with this issue to give it context but apart from that they are separate.
@sun Thanks, I've included Seven styling in this patch.
This looks like the wrong direction to me. With Stark, if a developer wants to use a fieldset without styling they would use #type 'fieldgroup'. So in Seven the correct way would be to add default styling to the fieldset element and then undo it when the .fieldgroup class is applied? Am I understanding this right?
Comment #15
emma.mariaComment #16
LewisNymanAssigning to sun because we need some clarification before we move forward.
Comment #19
LewisNymanUnassigning. In my eyes the requirements here and in #2002336: Introduce a CSS class to hide borders of fieldset elements are completely different. This one is "I want elements that aren't fieldsets to look like a fieldset" and the other is "I want fieldsets to look like they aren't fieldsets". We can't use the fieldgroup FAPI type here, it will have completely different results between Stark and Seven.
I'm going to build on the patch from #6, and see if I can drop the class into the correct elements through the Seven theme layer.
Comment #20
LewisNymanHere's a comparison of CSS UI frameworks they all seem to use the term 'panel' for this component. This is just as problematic. In other situations we've opted for the wider web conventions over Drupal naming conventions, but it feels a little dangerous.
Does anyone have a problem with a 'box' class?
Comment #21
LewisNymanGoing to revive this. We should use panel, there is a precedent for using common terms outside of Drupal instead of giving preference to Drupalisms.
Comment #22
andypostIs this still make sense in 8.0?
Comment #23
andypostComment #32
colan@damiankloip (#13): Did you create another issue for this? I couldn't find anything in the core queue (although I did find the Views Exposed Form Fieldset contrib module).
Comment #39
mherchelMoving this over to the Seven theme now that it's out of core.