Skip to content
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

Facet collapse breakpoint (facets-toggleable-md) should be customizable #2733

Open
seanaery opened this issue Jun 8, 2022 · 3 comments
Open

Comments

@seanaery
Copy link

seanaery commented Jun 8, 2022

The FacetGroupComponent view component has a hard-coded value for the classes:
class: 'facets sidenav facets-toggleable-md'

This makes the facets collapse under a hamburger menu toggle below the large breakpoint (< 992px by default).

This works OK if you use the default col-lg-3 sidebar + col-lg-9 main content layout. But if you are overriding Blacklight's (useful) layout helpers to specify different classes (e.g., to keep the facets sidebar visible at the md or sm breakpoints), you'd also need to change facets-toggleable-md to be -sm or -xs.

Screen Shot 2022-06-08 at 3 09 37 PM

@barmintor
Copy link
Contributor

Just to note that on recent releases of Blacklight, you should be able to override the template associated with that component in your application (app/components/blacklight/response/facet_group_component.html.erb) as a workaround - of course you could also implement an entirely new component.

Overriding helpers is IME a path to difficulty in maintenance - how would you go about it otherwise?

@barmintor
Copy link
Contributor

(I'll add that overriding the component template is a maintenance risk, too - they're really intended to be private implementations.)

@seanaery
Copy link
Author

Many thanks for taking a look at this @barmintor and especially for your perspective on maintenance costs. What I had in mind when creating the ticket was potentially adding the class as a new param on the FacetGroupComponent (much like id & title), so one could override the _facets.html.erb partial to specify custom classes when the component is instantiated.

That might also not be the best solution, and I defer to the Blacklight maintainers on the optimal approach. As someone currently working on several local Blacklight 6 -> 7 migrations, I wanted to point out these sidebar + content responsive layout classes as an area that Blacklight 6 had a precedent for customizing fairly easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants