Skip to content

Commit b49d80e

Browse files
authored
Fix issue where container padding not applied when using object syntax (#2353)
1 parent 9760468 commit b49d80e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
- Fix issue where container padding not applied when using object syntax ([#2353](https://github.com/tailwindlabs/tailwindcss/pull/2353))
1111

1212
## [1.8.5] - 2020-09-07
1313

__tests__/containerPlugin.test.js

+6
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ test('responsive horizontal padding can be included by default', () => {
209209
[container()],
210210
config({
211211
theme: {
212+
screens: {
213+
sm: '576px',
214+
md: { min: '768px' },
215+
lg: { 'min-width': '992px' },
216+
xl: { min: '1200px', max: '1600px' },
217+
},
212218
container: {
213219
padding: {
214220
default: '1rem',

src/plugins/container.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ function mapMinWidthsToPadding(minWidths, screens, paddings) {
4949

5050
_.each(minWidths, minWidth => {
5151
Object.keys(screens).forEach(screen => {
52-
if (`${screens[screen]}` === `${minWidth}`) {
52+
const screenMinWidth = _.isPlainObject(screens[screen])
53+
? screens[screen].min || screens[screen]['min-width']
54+
: screens[screen]
55+
56+
if (`${screenMinWidth}` === `${minWidth}`) {
5357
mapping.push({
5458
screen,
5559
minWidth,

0 commit comments

Comments
 (0)