Fix search input clear button and hint container positioning#194
Merged
fabiankaegy merged 8 commits intomainfrom Apr 8, 2026
Merged
Fix search input clear button and hint container positioning#194fabiankaegy merged 8 commits intomainfrom
fabiankaegy merged 8 commits intomainfrom
Conversation
Override third-party search plugin styles to properly position the clear button and keyboard shortcut hint inside the search input. Remove fragile exact-match searchHintContainer selector.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Scope clear button and hint container selectors under .navbar__search to beat the package's CSS module specificity and cascade order.
The package selector uses two classes (0,2,0), so our override needs three classes (0,3,0) to win regardless of cascade order.
Specificity alone can't reliably beat the third-party package styles due to unpredictable cascade order. Use !important to guarantee our overrides apply.
The element may have multiple classes, so [class^=] fails when searchClearButton_ isn't the first class in the attribute.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@easyops-cn/docusaurus-search-localstyles to properly position the clear button (absolute, right-aligned at 7px) and keyboard shortcut hint container (absolute, right-aligned at 10px) inside the navbar search inputsearchHintContainerselector in favor of existing robust[class^="searchHintContainer_"]prefix selector inhomepage-components.cssTest plan