Fix issue where container padding not applied when using object syntax (#2353)

This commit is contained in:
Adam Wathan 2020-09-09 09:59:16 -04:00 • committed by GitHub
parent 9760468e5b
commit b49d80e6c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing yet!
- Fix issue where container padding not applied when using object syntax ([#2353](https://github.com/tailwindlabs/tailwindcss/pull/2353))
## [1.8.5] - 2020-09-07

View file

@ -209,6 +209,12 @@ test('responsive horizontal padding can be included by default', () => {
[container()],
config({
theme: {
screens: {
sm: '576px',
md: { min: '768px' },
lg: { 'min-width': '992px' },
xl: { min: '1200px', max: '1600px' },
},
container: {
padding: {
default: '1rem',

View file

@ -49,7 +49,11 @@ function mapMinWidthsToPadding(minWidths, screens, paddings) {
_.each(minWidths, minWidth => {
Object.keys(screens).forEach(screen => {
if (`${screens[screen]}` === `${minWidth}`) {
const screenMinWidth = _.isPlainObject(screens[screen])
? screens[screen].min || screens[screen]['min-width']
: screens[screen]
if (`${screenMinWidth}` === `${minWidth}`) {
mapping.push({
screen,
minWidth,