Skip to content

fix(client, curriculum): center images in challenge description - #55190

Merged
Sembauke merged 5 commits into
freeCodeCamp:mainfrom
huyenltnguyen:fix/challenge-images
Jun 24, 2024
Merged

Sembauke merged 5 commits into
freeCodeCamp:mainfrom
huyenltnguyen:fix/challenge-images

Conversation

@huyenltnguyen

@huyenltnguyen huyenltnguyen commented Jun 14, 2024 •

Copy link
Copy Markdown
Member

Checklist:

This PR fixes an image alignment issue caused by #55068.

Screenshots

Before After
Screenshot 2024-06-14 at 02 48 02 Screenshot 2024-06-14 at 02 52 04

@github-actions github-actions Bot added the scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. label Jun 14, 2024

@Dario-DC Dario-DC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you haven't done it yet, could you include this two? 🙂

<img class="img-responsive center-block" alt="a 2-dimensional vector of coordinates (2, 3)" src="https://cdn.freecodecamp.org/curriculum/python/2dvector.png" style="background-color: white; height: 350px; width: auto; padding: 15px;">

<img class="img-responsive center-block" alt="a 3-dimensional vector of coordinates (4, 6, 3)" src="https://cdn.freecodecamp.org/curriculum/python/3dvector.png" style="background-color: white; height: 350px; width: auto; padding: 15px;">

@huyenltnguyen

Copy link
Copy Markdown
Member Author

@Dario-DC Hah, I missed those. Thank you! 😄

@huyenltnguyen
huyenltnguyen marked this pull request as ready for review June 14, 2024 09:35
@moT01 moT01 added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Jun 14, 2024
@ojeytonwilliams ojeytonwilliams added the bookmark Start next issue/PR triage meeting here label Jun 20, 2024

@ojeytonwilliams ojeytonwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @huyenltnguyen.

LGTM 👍

@moT01

moT01 commented Jun 20, 2024 •

Copy link
Copy Markdown
Member

Wondering if this is the best approach. I'm fine with it, but couldn't we do something like .description > img { margin: auto } - so it's a little more universal?

Also wondering about other clients. Maybe it will make things more difficult for mobile or other future clients, in that they may have to overwrite the inline styles. Perhaps that's fine.

Also now wondering if the left alignment is better - or maybe, good enough.

@huyenltnguyen

Copy link
Copy Markdown
Member Author

Wondering if this is the best approach. I'm fine with it, but couldn't we do something like .description > img { margin: auto } - so it's a little more universal?

The only reason I didn't go with adding the styles in a stylesheet is because there are already inline styles, so keeping the styles in one place is easier to manage.

Also wondering about other clients. Maybe it will make things more difficult for mobile or other future clients, in that they may have to overwrite the inline styles.

I was wondering the same. I'm not sure if we want to have inline styles in the curriculum content at all, and was thinking how we could style the content in a different way.

I think an alternative approach is to include the desired layout/arrangement in the metadata, similar to the dialog in the scene JSON of English challenges. The clients would parse the metadata and handle the display accordingly.

Do you think this approach makes sense, and is it something we can add to CAP / CAP API?

@Sembauke
Sembauke requested a review from moT01 June 21, 2024 15:50
@Sembauke

Copy link
Copy Markdown
Member

Thanks Huyen!

@Sembauke
Sembauke merged commit 7f381b3 into freeCodeCamp:main Jun 24, 2024
@ojeytonwilliams ojeytonwilliams removed the bookmark Start next issue/PR triage meeting here label Sep 26, 2024
@huyenltnguyen
huyenltnguyen deleted the fix/challenge-images branch September 26, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants