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

[v2] styling bug when using the default preset for algolia search #1851

Closed
jackyef opened this issue Oct 17, 2019 · 3 comments · Fixed by #1915
Closed

[v2] styling bug when using the default preset for algolia search #1851

jackyef opened this issue Oct 17, 2019 · 3 comments · Fixed by #1915
Labels
good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.

Comments

@jackyef
Copy link

jackyef commented Oct 17, 2019

🐛 Bug Report

The styling for algolia search seems to be broken in some cases when using docusarus v2.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Go to https://react-isomorphic-data.netlify.com/
  2. Type "with" or "use" into the searchbar.
  3. The styling for the search result is broken
    image

Expected behavior

I would expect the algolia search results to be displayed correctly, without the big gap in the center

Actual Behavior

image

Reproducible Demo

The repo for the site can be seen here: https://github.com/jackyef/react-isomorphic-data/tree/master/docusaurus

@endiliey endiliey added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. 2.x help wanted Asking for outside help and/or contributions to this particular issue or PR. labels Oct 18, 2019
@yangshun
Copy link
Contributor

I did some digging into the issue and I think the root cause could be one of these two:

  1. Algolia changed some HTML and CSS but because we cloned their CSS in docusaurus-theme-search-algolia/src/theme/SearchBar/styles.css, our CSS is outdated and no longer matches the updated styles.
  2. Algolia currently has a bug.

See the attached screenshots. I was comparing the difference between the working HTML and the buggy HTML - the buggy HTML seems to have missing classes that were present in other rows. Adding those two classes fixed the layout issue.

Screen Shot 2019-10-18 at 4 15 57 AM

Screen Shot 2019-10-18 at 4 16 15 AM

@endiliey any reason why we cloned Algolia's CSS here? Is that the correct way to use Algolia Docsearch?

@endiliey
Copy link
Contributor

Its reactjs.org css 😊.

The default one wasnt as nice and iirc is only available through cdn. Also colocated the css so that its swizzle-able easily.

P.S: waiting for stable release of docsearch v3 which is so much smaller in bundle size and came with dark/light theme css. They rewrote it from scratch and no longer relies on zeptojs

@yangshun yangshun changed the title [v2] Styling bug when using he default preset for algolia search [v2] styling bug when using the default preset for algolia search Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants