Skip to content

Search plugin: add "show-results" class to parent element when showing results #535

Description

@jhildenbiddle

When showing results, the search plugin adds a "show" class to certain elements to change styles. Specifically, it adds the "show" class the the clear button and the results panel:

<divclass="search"><divclass="input-wrap"><inputtype="search" value="" placeholder="Search..."><buttonclass="clear-button show" aria-label="Clear search">...</button></div><divclass="results-panel show">...</div></div>

It would be helpful to have this a class added to the search wrapper as follows:

<divclass="search show-results">

Adding this class to the search wrapper will allow the sidebar navigation to be hidden when the search results are displayed using only CSS.

This functionality has been added to docsify-themeable by way of a small plugin, but ideally this would be handled by docsify out-of-the-box. Source code for the plugin can be viewed here:

(Making this change in the docsify source would be much easier than fixing this via plugin).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions