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

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

Merged
merged 5 commits into from
Jun 24, 2024

Conversation

huyenltnguyen
Copy link
Member

@huyenltnguyen huyenltnguyen commented Jun 14, 2024

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
Copy link
Contributor

@Dario-DC Dario-DC left a comment

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
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 triage meeting here label Jun 20, 2024
Copy link
Contributor

@ojeytonwilliams ojeytonwilliams left a comment

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
Copy link
Member

moT01 commented Jun 20, 2024

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
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
Member

Thanks Huyen!

@Sembauke Sembauke merged commit 7f381b3 into freeCodeCamp:main Jun 24, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookmark Start next issue triage meeting here 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.

None yet

5 participants