-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor: make dynamic authors layout via CSS only #5424
Conversation
✔️ [V2] 🔨 Explore the source changes: becb869 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61277c65510444000813bb4d 😎 Browse the preview: https://deploy-preview-5424--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5424--docusaurus-2.netlify.app/ |
Size Change: +189 B (0%) Total Size: 814 kB
ℹ️ View Unchanged
|
✔️ [V2] 🔨 Explore the source changes: bd4744b 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61277cba0f66ff0008c4377a 😎 Browse the preview: https://deploy-preview-5424--docusaurus-2.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must admit I'm not too fan of using important!
.
If we don't strictly adhere to Infima's grid, why use it in the first place instead of just flex: 0 1 50%
?
Also my idea was to allow swizzlers to easily move to a 3-col layout if they want to (but agree this may seem more complicated and a bit overkill).
No strong opinions, I'm ok to merge this if you want but I'm not sure yet it's the right thing to do.
I like to change existing column, although this will require using On the other hand, we can define your own column, but we still need to use @media only screen and (min-width: 997px) {
.authorCol {
flex: 1 1 50% !important;
}
} So which option is better? As for swizzling, it's a pretty rare use case that we don't particularly recommend; so I'd use usual CSS-like solution to make layout, and avoid having to use JS to do it.
Well that's pretty ambiguous, it might be easier for user to set up three-column layout using CSS-grid, rather than JS. |
ok, let's merge this for now |
Motivation
When we have two-column layout for authors, we can remove JS logic of adding right class depending of authors numbers -- just we need to add little extra CSS code to get the same result.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)