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

Problem: Images on static pages overflow on the bootstrap 5 theme #1610

Closed
anvit opened this issue Jun 15, 2023 · 4 comments · Fixed by #1614
Closed

Problem: Images on static pages overflow on the bootstrap 5 theme #1610

anvit opened this issue Jun 15, 2023 · 4 comments · Fixed by #1614
Assignees
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Milestone

Comments

@anvit
Copy link
Contributor

anvit commented Jun 15, 2023

Current Behavior

Steps to reproduce the behavior

  1. Create a static page.
  2. Add a large image to it. For e.g. add this to a static page:
<div>
    <p>Hello World</p>
    <p><img src="http://placekitten.com/1920/600" alt="a cat" /></p>
</div>

  1. Notice how the image goes outside the bounds.

Expected Behavior

Image should not grow outside the container.

Possible Solution

This likely stems from Bootstrap 5 removing the max-width: 100% style from the img tag. It probably doesn't show up in other places because the classes applied to images elsewhere take care of this.

A temporary way to fix this on static pages in the meantime would be to add a class="img-fluid" to any images to fix this.

Version used

AtoM 2.7.2

@anvit anvit added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Jun 15, 2023
@anvit anvit added this to the 2.8.0 milestone Jun 15, 2023
@fiver-watson
Copy link
Contributor

Just as an FYI, depending on how you address this: there are 2 places in the docs that should probably be reviewed in light of however you proceed. One option is simply to document the recommendation to use the img-fluid class - there are similar BS2 classes suggested in the docs for styling currently.

The Manage Static Pages documentation page includes a section on formatting. This covers some basic HTML examples that can be used on static pages, and the Images subsection includes some BS2 classes that may no longer be relevant:

This whole section also links to the Formatting documentation page on Markdown use:

@jraddaoui
Copy link
Contributor

To avoid changing all existing static pages, we could add some default CSS rules to all images in all static pages (body.staticpage img) to keep the same behavior as in Bootstrap 2.

@anvit
Copy link
Contributor Author

anvit commented Jun 16, 2023

Thanks @fiver-watson! Will review the docs and update them. A lot of those existing classes seem to still be valid, but it would be good to document image classes for Bootstrap 5.

@jraddaoui Yup! That's the plan for the next release. The img-fluid class is only a temporary workaround we could suggest for users currently on a BS5 theme.

mcantelon added a commit that referenced this issue Jun 17, 2023
* Fixed password reset tool Symfony task description text
* Made task use the standard AtoM base class for tasks
@anvit
Copy link
Contributor Author

anvit commented Jun 20, 2023

Created a PR for AtoM docs updates for changes related to BS5 classes: artefactual/atom-docs#223

@anvit anvit self-assigned this Jun 20, 2023
anvit added a commit that referenced this issue Jun 20, 2023
Add css styles to fix overflowing images in static pages with large
width.
@anvit anvit linked a pull request Jun 20, 2023 that will close this issue
mcantelon added a commit that referenced this issue Jun 20, 2023
* Fixed password reset tool Symfony task description text
* Made task use the standard AtoM base class for tasks
anvit added a commit that referenced this issue Jun 20, 2023
Add css styles to fix overflowing images in static pages with large
width.
anvit added a commit that referenced this issue Jun 21, 2023
Add a max-width to fix overflowing images in static pages with large
width.
anvit added a commit that referenced this issue Jun 21, 2023
Add a max-width to fix overflowing images in static pages with large
width.
@anvit anvit modified the milestones: 2.8.0, 2.7.3 Jun 29, 2023
Mbtj pushed a commit that referenced this issue Jul 5, 2023
Add a max-width to fix overflowing images in static pages with large
width.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants