8000 _media doesn't evaluate dynamically · Issue #799 · lowdefy/lowdefy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
_media doesn't evaluate dynamically #799
Open
@Radiergummi

Description

@Radiergummi

The _media operator returns information about the current screen dimensions, but doesn't update them if the size changes during client runtime.
Ideally, the data would change if the window is resized, so block visibility could be controlled by media queries, similar to CSS.

There's mainly two ways this can be achieved in modern browsers:

  1. The resize event:
    Listening to the event (ideally debounced), we can set the current screen dimensions after the window has been resized.
  2. The matchMedia() function:
    Using matchMedia, we can attach CSS media queries to the window object and add event listeners that will be triggered if the query starts to match, or doesn't match any longer. This allows to set named breakpoints (eg. sm, lg, etc.) in the application state.

By implementing those features combined, we could have up-to-date media query information available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0