-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix media query range minimum off-by-one
- Loading branch information
Showing
5 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,36 @@ | |
|
||
## 🚨 Breaking Changes | ||
|
||
### Breakpoint Boundaries | ||
|
||
Prior to `v4.0.0` `twrnc` displayed subtly different behavior for media query ranges from | ||
TailwindCSS. Specifically, TailwindCSS media queries are **inclusive** of the _minimum_, | ||
and older versions of `twrnc` were **exclusive** of the range minimum. In practical terms | ||
that means that a utility like `md:bg-black` is applicable in TailwindCSS _when the screen | ||
size is **exactly** `768px` wide,_ whereas in `[email protected]` that class would only begin to | ||
apply at **`769px`.** Version `4.0.0` corrects this off-by-one error, making the library | ||
more consistent with TailwindCSS. | ||
|
||
We think that this will not affect most library consumers, but it is possible that you | ||
could see a difference in appearance if your device window size is precisely the same as a | ||
media query range minimum, so this is technically a breaking change. | ||
|
||
If you'd like to restore the prior behavior, you can customize your theme's `screens`, | ||
settings: | ||
|
||
```js | ||
module.exports = { | ||
theme: { | ||
screens: { | ||
sm: '641px', | ||
md: '769px', | ||
lg: '1025px', | ||
xl: '1281px', | ||
}, | ||
}, | ||
}; | ||
``` | ||
|
||
### `useAppColorScheme()` Initialization | ||
|
||
_NB: If you were not using dark mode, or were only observing the device's color scheme | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters