-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for setting
screens
in JS config (#14415)
This PR adds support for the _simple_ case of the `screens` option inside JS config paths. This allows JS configs to extend the responsive theme by adding custom breakpoints. Here's an example from our v3 docs: ```js { theme: { screens: { 'sm': '640px', // => @media (min-width: 640px) { ... } 'md': '768px', // => @media (min-width: 768px) { ... } 'lg': '1024px', // => @media (min-width: 1024px) { ... } 'xl': '1280px', // => @media (min-width: 1280px) { ... } '2xl': '1536px', // => @media (min-width: 1536px) { ... } } } } ``` For simple breakpoints, this will extend the core breakpoints and will work with the `min-*` and `max-*` utilities. However, we also support complex ways of setting up custom screens like this: ```js { theme: { extend: { screens: { sm: { max: '639px' }, md: [ { min: '668px', max: '767px' }, { min: '868px' }, ], lg: { min: '868px' }, xl: { min: '1024px', max: '1279px' }, tall: { raw: '(min-height: 800px)' }, }, }, }, } ``` For these complex setups, we _only_ generate the shorthand variant (e.g. `tall`) but those won't integrate within `min-*` and `max-*`. In v3, adding any of these complex configurations would omit any `min-*` and `max-*` variants.
- Loading branch information
1 parent
6ca8cc6
commit 2ddb715
Showing
9 changed files
with
806 additions
and
27 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
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
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
Oops, something went wrong.