Skip to content

Commit

Permalink
Fix issue where container padding not applied when using object syntax (
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan authored Sep 9, 2020
1 parent 9760468 commit b49d80e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions __tests__/containerPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b49d80e

Please sign in to comment.