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

How can I customize the style of this plugin's search area ? #30

Open
listky opened this issue Aug 10, 2022 · 6 comments
Open

How can I customize the style of this plugin's search area ? #30

listky opened this issue Aug 10, 2022 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@listky
Copy link

listky commented Aug 10, 2022

I want the width of this area could be fixed instead of being flex with those search results, by the way, this is a wonderful plugin for vuepress2 ,hope to receive your reply

image
image

@ota-meshi
Copy link
Owner

Can't you customize using CSS? If you can't do it with CSS, you may not be able to customize it.

@listky
Copy link
Author

listky commented Aug 12, 2022

I will try it by using CSS only if I know where it is defined, tks please

@RaniAgus
Copy link

RaniAgus commented Sep 5, 2022

I found some SCSS variables (that could be overriden in Styles File) here:

:global(:root) {
--search-bg-color: #ffffff;
--search-accent-color: #3eaf7c;
--search-accent-text-color: #fff;
--search-text-color: #2c3e50;
--search-border-color: #eaecef;
--search-item-text-color: #5d81a5;
--search-item-focus-bg-color: #f3f4f5;
--search-input-width: 8rem;
--search-result-width: 20rem;
}

Sadly, page titles' background color doesn't seem to be customizable because it's hardcoded:

@rxliuli
Copy link

rxliuli commented Sep 13, 2022

--search-result-width: 20rem;

This variable doesn't seem to be used?

image

@ota-meshi ota-meshi added the help wanted Extra attention is needed label Sep 13, 2022
@ota-meshi
Copy link
Owner

Welcome PRs to fix it.

@twgh
Copy link

twgh commented Sep 17, 2022

docs\.vuepress\styles\index.scss里添加css代码, 我目前用的是这样的:

:root {
  --search-input-width: 8rem !important;
  --search-result-width: 100% !important;
}

.suggestions {
  position: fixed !important;
  left: 18vw !important;
  top: calc(var(--navbar-line-height) + 7px) !important;
  max-width: 100% !important;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants