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

Improve blog layout #4083

Closed
slorber opened this issue Jan 21, 2021 · 6 comments · Fixed by facebookincubator/infima#62
Closed

Improve blog layout #4083

slorber opened this issue Jan 21, 2021 · 6 comments · Fixed by facebookincubator/infima#62
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@slorber
Copy link
Collaborator

slorber commented Jan 21, 2021

🐛 Bug Report

The current blog layout is not ideal, particularly on large screens where blog titles wrap unnecessarily.

image

Also the spacing is not very good when there's a blog post list scrollbar

image

The ReactNative site has a better blog layout using custom CSS, but it's not ideal either to write this CSS as we have to target classes of the Infima grid system in a fragile way

image

For example, I used a similar solution for the Jest v2 website:

.main-wrapper.blog-wrapper .container .row {

  // Blog post list
  .col.col--2:first-child {
    --ifm-col-width: 22%;
    div[class^='sidebar'] {
      padding-right: 1rem;
    }
  }

  // Center
  .col.col--8 {
    --ifm-col-width: 62%;
    @media only screen and (max-width: 996px) {
      --ifm-col-width: 100% !important;
    }
  }

  // TOC
  .col.col--2:last-child {
    --ifm-col-width: 16%;
  }
}

We should rather adopt current ReactNative design in the default Docusaurus blog layout design in future versions, and stop using a basic css grid for that as we want the sides to grow when space is available.

cc @lex111 @Simek

@slorber slorber added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jan 21, 2021
@slorber
Copy link
Collaborator Author

slorber commented Feb 22, 2021

@lex111 is the infima PR enough to improve the blog layout? IMHO it's not so I'll re-open but let me know what you think.

@slorber slorber reopened this Feb 22, 2021
@lex111
Copy link
Contributor

lex111 commented Feb 22, 2021

@slorber yes, for solve this issue we need to release new version of Infima, then slightly change blog markup during upgrading to its new version. Can you want to release new version of Infima?

@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 4, 2021
@lex111
Copy link
Contributor

lex111 commented Mar 9, 2021

Fixed in #4370.

@lex111 lex111 closed this as completed Mar 9, 2021
@lex111 lex111 removed this from the v2.0.0-alpha.71 milestone Mar 9, 2021
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 7, 2022
@maheshj01
Copy link

@lex111 Is it possible to customize this layout with react?

@slorber
Copy link
Collaborator Author

slorber commented Mar 29, 2024

@maheshmnj yes you can swizzle any theme component and customize them

@maheshj01
Copy link

maheshj01 commented Mar 30, 2024

@slorber I meant can we use a custom react component e.g

  1. I would like to use a custom footer and it should be available on blog layout pages as well as main page.
  2. Change the layout of blog content

If this is possible, is there a sample code you can point me at for reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants