Skip to content

Ensure facet filter gray box (in modal or facet browse page) doesn't …#3553

Merged
jcoyne merged 1 commit intomainfrom
3552-hide-empty-facet-filters
Apr 10, 2025
Merged

Ensure facet filter gray box (in modal or facet browse page) doesn't …#3553
jcoyne merged 1 commit intomainfrom
3552-hide-empty-facet-filters

Conversation

@seanaery
Copy link
Copy Markdown
Contributor

@seanaery seanaery commented Apr 3, 2025

…appear if it's empty. Fixes #3552.

  • this area will be empty for facets configured with suggest: false
  • uses a simple :has CSS rule rather than complicate the template rendering

…appear if it's empty. Fixes #3552.

- this area will be empty for facets configured with suggest: false
- uses a simple :has CSS rule rather than complicate the template rendering
@seanaery
Copy link
Copy Markdown
Contributor Author

seanaery commented Apr 3, 2025

With suggest: false...
Screenshot 2025-04-03 at 3 18 19 PM

With suggest: false, but index_range: true and in A-Z Sort...
Screenshot 2025-04-03 at 3 18 29 PM

With suggest: true...
Screenshot 2025-04-03 at 3 20 05 PM

With suggest: true and index_range: true and in A-Z Sort...
Screenshot 2025-04-03 at 3 20 11 PM
d

/* Facet browse pages & modals
-------------------------------------------------- */
.facet-filters:not(:has(*)) {
display: none !important;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this have to be !important?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question -- thanks for flagging that. It turns out, that is due to a related bug. The .facet-filters div is also a .card, and all .card elements get display: flex from Bootstrap CSS.

The generated application.css is currently putting the Bootstrap CSS after the Blacklight CSS (per this code), so the Bootstrap styles are taking precedence without !important.

I will create a bug ticket for that order issue, and a PR, then afterward I can rebase this PR and remove the !important.

@jcoyne jcoyne merged commit e8afb1d into main Apr 10, 2025
10 checks passed
@jcoyne jcoyne deleted the 3552-hide-empty-facet-filters branch April 10, 2025 13:03
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

Successfully merging this pull request may close these issues.

Facet modal looks odd when filtering/suggest is turned off

3 participants