meilisearch / vuepress-plugin-meilisearch

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

The custom style doesn't seem to work. #295

Open eryajf opened 1 year ago

eryajf commented 1 year ago

I added a configuration file to specify a custom style: https://github.com/eryajf/eryajf.github.io/blob/main/docs/.vuepress/styles/palette.styl (At the bottom)

But it doesn't seem to work.

My blog is: https://wiki.eryajf.net

bidoubiwa commented 1 year ago

We have a custom style on the documentation: https://github.com/meilisearch/documentation/tree/main/.vuepress/styles

Based on this example, what are the difference with your implementation?

eryajf commented 1 year ago

Whether the search box should be customized through the following variables:

// meilisearch 样式自定义
$accentDarkColor = #FF85BF
$textDarkColor = #FAFBFE
$borderDarkColor = #352A43

After my blog is configured like this, the final effect is as follows:

image_20230215_192311

bidoubiwa commented 1 year ago

It may be an issue on our template side. I think I had to manually rewrite the rules. See here: https://github.com/meilisearch/documentation/blob/671a352fa171ba512dd0ed123daea8f2a78b49f1/.vuepress/styles/index.styl#L86

If you do that, does it solve your issue? If yes, than this is a bug that needs to be fixed here

eryajf commented 1 year ago

If I just copy the following paragraph, nothing has changed on my side.

``` @media (prefers-color-scheme: dark) { .el-tabs--border-card>.el-tabs__header { color: $accentDarkColor; background-color: #11071D !important; border: 1px solid $bgDarkColor !important; } .el-tabs__item.is-active { color: $accentDarkColor !important; background-color: #170E23 !important; border-right: 1px solid #251D30 !important; border-left: 1px solid #251D30 !important; } // wrapper arround the code in tabs .el-tabs { background-color: #170E23 !important; border: 1px solid #251D30 !important; border-radius: 8px; } // Content of code .extra-class > pre { background-color: #11071D !important; } } ```

When I copied the entire index.styl , I got the effect below.

image_20230215_205915

So I don't know exactly what affects the style of the search box

bidoubiwa commented 1 year ago

Hey @eryajf

Is your blog on a public repo by any chance? I would love to try to debug it using your blog as an example. If not, no problem I'll try it differently

eryajf commented 1 year ago

@bidoubiwa yes, see : https://github.com/eryajf/eryajf.github.io