-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Add people-rows ArchieML component #4235
Conversation
rakyi
commented
Nov 29, 2024
•
edited
Loading
edited
- The new component allows us to have rows of people in two columns
- Add socials to person block
@ikesau I tried to make use of more of the existing grid system, but I still think flex makes the most sense for switching from a two column layout on a bigger screen to a single column on a small screen, given the constraints I explained before. LMK what you think. |
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-11-29 17:30:53 UTC |
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.
nice and easy 👍
the css grid saga continues 😂
site/gdocs/components/People.tsx
Outdated
className={cx( | ||
"people", | ||
{ | ||
"people-cols-2": columns === "2", |
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.
If I'm understanding the requirements correctly based on what it's currently doing when i test the article on staging, when columns: 2
is set, we want:
lg - 1 column
md - 2 coumns
sm - 1 column
if so, could you do something like:
const columnClassNames = {
1: "grid-cols-1",
2: "grid-sm-cols-1 grid-md-cols-2 grid-lg-cols-1"
}
<div className={cx("people grid", columnClassNames[columns])}>
...children
</div>
And then you don't have to worry about flex or that calc statement or anything. 🙂
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.
Yep, you are totally right. I somehow got the wrong impression about how ordering of elements changes in a grid when you change from two columns to a single column. Also, it should be just lg-up
instead of lg-only
. Thanks for being persistent. 🙂 Fortunately it's a small change and didn't cost us too much time.
* The new component allows us to have rows of people in two columns * Add socials to person block