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 image constraints #341

Merged
merged 1 commit into from
Sep 17, 2020
Merged

fix image constraints #341

merged 1 commit into from
Sep 17, 2020

Conversation

jaredgalanis
Copy link
Member

Co-Authored-By: Chris Manson mansona@users.noreply.github.com

@mansona
Copy link
Member

mansona commented Sep 4, 2020

@pichfl do you think this would have any negative effects? 🤔 the idea is to have a global rule because we can't add a specific class to images that are added to Markdown

Base automatically changed from markdown-styles to master September 4, 2020 12:01
@pichfl
Copy link
Contributor

pichfl commented Sep 4, 2020

By setting only the max-width images may distort. max-width: 100%; height: auto; would change that but it might have unexpected side effects. We should rather fix anything that breaks though, I think having this as a base is reasonable.

@jaredgalanis
Copy link
Member Author

By setting only the max-width images may distort. max-width: 100%; height: auto; would change that but it might have unexpected side effects. We should rather fix anything that breaks though, I think having this as a base is reasonable.

Thanks @pichfl! I'm sorry I need one point of clarification in follow up. Are you saying we should include height: auto or it is fine as is?

@mansona
Copy link
Member

mansona commented Sep 10, 2020

So @pichfl, I probably didn't explain the need for this change explicitly enough. When you say "We should rather fix anything that breaks though" what precisely do you mean? 🤔

The issue that we have is that we can't actually manually fix all images in some of the sites that use the ember-styleguide because we are making use of Markdown quite heavily. For this reason, we need to have sensible defaults defined in global styles that can apply without the need of specifying a class on the image.

For example, if you look at the example markdown page on master you will see that there is currently an image that is exploding off the side of the page: https://ember-styleguide.netlify.app/concepts/markdown/ (also you can see that the corresponding page is fixed in this PR: https://deploy-preview-341--ember-styleguide.netlify.app/concepts/markdown/ )

I'm happy for us to put in the height: auto rule if you think that would help this situation but I would be curious what you mean by "unexpected side effects" 🤔

- images in markdown breakout of their container as described in #335
- this sets a max width to constrain them

Co-Authored-By: Chris Manson <mansona@users.noreply.github.com>
@mansona
Copy link
Member

mansona commented Sep 10, 2020

Also I created two branches ember-learn/ember-website#666 and ember-learn/ember-website#665 that test with height: auto and without 🎉

Percy sees no difference between them but I guess that this could be because Percy uses Chrome? 🤔 Is there something that I should be looking for?

@ijlee2
Copy link
Member

ijlee2 commented Sep 13, 2020

In case this CSS approach may help: https://github.com/ijlee2/ember-container-query/blob/main/tests/dummy/app/components/widgets/widget-3/tour-schedule/responsive-image/index.css

I don't think IE 11 supports object-fit, however. (grid either...)

@mansona
Copy link
Member

mansona commented Sep 17, 2020

@ijlee2 so this sort of solution isn't really available to us, we need to make sure that the default implementation (without using classes) works because of the nature of the way Markdown is being rendered in our infrastructure 👍 nice pointer though 😍 🎉

Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

I'm going to go ahead with this change as is for now 👍 Because we ran the experiment with and without height: auto; and couldn't find any difference we think it's safe to leave it like this for the time being. If we find any evidence of distortions going forward we will look at what caused them and consider adding height: auto; as a bugfix at that stage 🎉

@mansona mansona merged commit 28ef014 into master Sep 17, 2020
@mansona mansona deleted the fix-image-constraints branch September 17, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants