Giter Club home page Giter Club logo

svelte-media-queries's Introduction

Leonardo re Vinci

Peace and Love 💙💛

🎸 Languages

Languages

🪄 Technologies

Technologies

🕹️ Tools

Tools

👾 Who am I

Write to me if you find out🥲

🌟 Major Projects

There are too many of them.. As soon as there is time, I will definitely add them
But now I'm working on Cue

Statistics🗓

fedorovvvv

svelte-media-queries's People

Contributors

bosticka avatar fedorovvvv avatar ian-viri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

svelte-media-queries's Issues

[TypeScript] Type error on destructured matches property when using array of queries

Description

When using <MediaQuery> component with an array of queries in query prop, Svelte indicates a cryptic TypeScript error on let:matches destructured property.

How to reproduce

<MediaQuery
        query={['(min-width: 768px) and (max-width: 1023px)', '(min-width: 1024px)']}
	let:matches
>
        <!-- Type error appears here on IDE -->
        {@const [tablet, desktop] = matches}
        <Comp matches={tablet} />
        <OtherComp matches={desktop} />
</MediaQuery>

Expected

No type errors from Svelte.

Actual

Svelte: Type  boolean | QueryArray | ObjectType<any>  must have a  [Symbol.iterator]()  method that returns an iterator.


Thanks by advance for your help!

Boolean media queries not working

Hey Nikita!

Nice work on this library. I noticed an issue with dynamic media queries. Compound queries return false, even when the individual queries return true.

Take a look at this screenshot from the REPL and I think you'll understand the issue:

Screenshot from 2022-11-30 15-57-07

I expected [true, true, true] in that last line.

Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.