Skip to content

[Feature request] $mq should work as a function #46

@AndrewBogdanovTSS

Description

@AndrewBogdanovTSS

Right now $mq is just a string - that is limiting its behavior significantly. I suggest to turn it into a function that could accept a string. That will enable true mobile-first experience. If an argument of specified breakpoint is passed - it should return true if it's currently within that breakpoint.
If a minus is added to the string - it will also include every breakpoint below the specified one.
If a plus is added to the string - it will also include every breakpoint above the specified one. Something like:

this.$mq('md') // will return true if screen width is == 'md'
this.$mq('md-') // will return true if screen width is <= 'md'
this.$mq('md+') // will return true if screen width is >= 'md'
this.$mq() // will return current breakpoint similar to how it's working now

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