Skip to content

Code consistency for screen width media queries #2048

@trichoplax

Description

@trichoplax

Can we agree on guidelines for how to write media queries for changing layout based on screen width? Currently:

  • Some are hardcoded and some use variables.
  • Some use pixels, some use rems, and some use ems.
  • Some use min-width and some use max-width.
  • Some use just one of min-width or max-width combined with a default, while others use both min-width and max-width.
  • Some use both min-width and max-width with the same width value, while others use both min-width and max-width but with width values 1 pixel different.

Can we document which of these are acceptable in general, which are exceptions and in which circumstances exceptions are appropriate?

Could we also have guidelines on default widths for such layout changes, so that as many as possible can happen together? This way the jumps during resizing a window can be kept to a minimum, with exceptions only where necessary.

How should we determine whether a particular layout change should be part of QPixel or Co-Design?

Is there anything else that we should standardise or document about our approach to responsive layouts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions