A possible bug (or a misunderstanding of the API)
See original GitHub issueI just started using this lib and I’m a little bit confused by the API. The docs give two examples with the md
breakpoint and the up
and down
functions respectively. The first example seems clear to me: ${up('md')}
translates to @media (min-width: 768px)
. But in the second example, ${down('md')}
translates to @media (max-width: 991.98px)
whereas I would have expected @media (max-width: 767.98px)
(also see the screenshot below).
On a given viewport width of 800px, both useBreakpoint(up('md'))
and useBreakpoint(down('md'))
return true at the same time. Maybe I’m understanding the API wrong, but shouldn’t they be mutually exclusive? I’d expect the latter to be false.
Merry Christmas and thank you in advance for your help 🙏
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bug #43972 for WWW-Facebook-API: Possible bug -- but could be ...
Greetings! I am trying to use WWW::Facebook::API and i cannot seem to even get to first base with it. Here is my sample...
Read more >Not sold! The end user does not care whose fault it is!
The problem is with the docs being written in English, it is not clear what is a API bug, and what is a...
Read more >Possible API bug with GSComponent.automaticAlignment - bug ...
Possible API bug with GSComponent.automaticAlignment ... It's possible I'm misunderstanding the intention of automaticAlignment though.
Read more >"Limit results" in Asset Management and Tagging API v2 does ...
I am wondering if this has been determined to be a bug, either by you or someone from Qualys? If not what is...
Read more >'[LLVMdev] Possible bug or misunderstanding of feature ...
... llvm-dev Subject: [LLVMdev] Possible bug or misunderstanding of feature ... the c api to get a integer of arbitrary size from a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, i’m afraid i have to agree with @SyFlo: the API for
down
feels weird, especially since it’s not how Bootstrap works.bootstrap:
@include media-breakpoint-down(md)
=@media (max-width: 767.98px)
(=down("sm")
)@include media-breakpoint-up(md)
=@media (min-width: 768px)
styled-breakpoints:
down("md")
=@media (max-width: 991.98px)
(=@include media-breakpoint-down(lg)
)up("md")
=@media (min-width: 768px)
Here’s a (crude) demo showing the differences: https://codesandbox.io/s/angry-boyd-vfn1k
There’s also a difference with
between
.bootstrap:
@include media-breakpoint-between(sm, md)
=@media (min-width: 576px) and (max-width: 767.98px)
styled-breakpoints:
between("sm", "md")
=@media (min-width: 576px) and (max-width: 991.98px)
But tbh i don’t really know how you could possibly align with Bootstrap without breaking changes… or maybe by providing alternative
downInclusive
andbetweenInclusive
methods (sorry i’m not good at naming things)?@mg901 Thank you for your answer and sorry for the delay, I’ve been away from keyboard over the last few days. Sure, I can work with that.