meilisearch / vuepress-plugin-meilisearch

Add a relevant and typo tolerant search bar to your VuePress
MIT License
63 stars 14 forks source link

fix: change input selector to id #264

Closed ColinFrick closed 1 year ago

ColinFrick commented 1 year ago

Pull Request

Related issue

Fixes #263

What does this PR do?

This does require a change in meilisearch/documentation because this does not handle @media (prefers-color-scheme: dark)

PR checklist

Please check if your PR fulfills the following requirements:

Thank you so much for contributing to Meilisearch!

bidoubiwa commented 1 year ago

Hey @ColinFrick thanks again for contributing :) Unfortunately if it is not compatible with the dark mode we cannot add it. Do you think this is something that can be done?

ColinFrick commented 1 year ago

@bidoubiwa the inconsistencies result from the different types of applying the dark / light mode styling in docs-searchbar.js and the documentation CSS. docs-searchbar.js uses [data-ds-theme] to determine the theme, while the documentation page uses (prefers-color-scheme: dark) directly.

Hm, because we set the theme through the plugin, it should be possible to apply the corresponding theme on the plugin tag directly without waiting for docs-searchbar.js to be initialized.

ColinFrick commented 1 year ago

@bidoubiwa I have changed the PR. This should cover any combination of prefers-color-scheme / enableDarkMode, and does not require any changes in the documentation repository.

bidoubiwa commented 1 year ago

docs-searchbar.js uses [data-ds-theme] to determine the theme, while the documentation page uses (prefers-color-scheme: dark) directly.

Do you think it is worth to change that in docs-searchbar.js ? As it is not exposed to the user.

ColinFrick commented 1 year ago

Even if we change docs-searchbar.js we still would need it here. It really comes down to that split second between rendering the DOM (with Vue component) and wrapping the component with docs-searchbar.js

ezgif-3-2ba7f0c446

bidoubiwa commented 1 year ago

bors merge

bidoubiwa commented 1 year ago

bors r-

bidoubiwa commented 1 year ago

bors merge

meili-bors[bot] commented 1 year ago

Build succeeded:

bidoubiwa commented 1 year ago

Thanks again for contributing with Meilisearch :heart: If you are participating in Hacktoberfest, and you would like to receive a small gift from Meilisearch too, don't forget to fill this form.