← Back to context

Comment by lelandfe

4 years ago

Hey Gitlab, could you consider adding the following CSS so that README images don't break out of their containers? Having to horizontally scroll to see this image is brutal.

    .md img {
        max-width: 100%;
        height: auto;
    }

I think that goes here: https://gitlab.com/gitlab-org/gitlab/-/blob/55a4cc5a53903250...

You’d want to pair that with `height: auto`, or else it’ll damage the aspect ratio of images that specify width and height attributes (which you always should).

  • Yep, will add.

    Image in question is missing those values. I personally think README images should be be lazyloaded (making those inlined aspect ratios important) but I guess that's down to the maintainer.

With the way people write CSS today, is there an argument today to not just have it be part of a reset, e.g.:

    img {
        max-width: 100%;
    }

  • That they are not already doing that made me believe it was intentional. Principle of least astonishment to start.

    Anyway I agree, and have that present on all projects.