Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5952

Ensure sizes attributes stay up to date with CSS

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Should have Should have
    • None
    • None
    • Performance

      The sizes attribute of images depends on all CSS that can affect how large the image is shown (padding, margin, width, borders,... of the element and it's parents and siblings).

      Many factors, but luckily there is a tool that can give the right sizes for each image by loading a page in a browser and resizing the page to all possible sizes. This tool was used to add missing sizes inĀ https://jira.greenpeace.org/browse/PLANET-5666

      If we make a change that affects a sizes attribute, this needs to be updated. We currently have no way of knowing that a change requires this.

      We have at least 2 options:

      1. Run the tool in CI to verify the attributes are still ok, and fail the pipeline if changes need to be made.
      2. Always generate the sizes in CI.

      Both would require using respimagelint in a CI job, which could be tricky but seems possible in a headless browser. In theory we only need to trigger the same JS that the bookmarklet does.

            Unassigned Unassigned
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: