Skip to content

Commit 11c8a91

Browse files
committed
Supportcontainer padding as string; support for Tailwind 1 default container padding syntax
1 parent 89b3332 commit 11c8a91

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [0.1.2] - 2021-03-02
7+
8+
* Support container padding as string
9+
* Support Tailwind 1 default container padding syntax where "default" key is lowercase
610

711
## [0.1.1] - 2021-03-01
812

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tailwindcss-container-bleed",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"main": "src/index.js",
55
"description": "Tailwind CSS plugin to generate container bleed utilities",
66
"author": "Bust Out",
@@ -19,7 +19,7 @@
1919
"tailwindcss-plugin"
2020
],
2121
"scripts": {
22-
"build:demo": "node scripts/build-demo.js"
22+
"build:docs": "node scripts/build-docs.js"
2323
},
2424
"peerDependencies": {
2525
"tailwindcss": ">=1.3.0"

scripts/build-demo.js renamed to scripts/build-docs.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const postcss = require('postcss')
33
const tailwind = require('tailwindcss')
44
const CleanCSS = require('clean-css')
55

6-
function buildDemoFile(filename) {
6+
function buildDocsFile(filename) {
77
return postcss([
88
tailwind({
99
theme: {
@@ -52,16 +52,16 @@ function buildDemoFile(filename) {
5252
])
5353
.process('@tailwind base; @tailwind components; @tailwind utilities;', {
5454
from: null,
55-
to: `./demo/${filename}.css`,
55+
to: `./docs/${filename}.css`,
5656
map: false,
5757
})
5858
.then((result) => {
59-
fs.writeFileSync(`./demo/${filename}.css`, result.css)
59+
fs.writeFileSync(`./docs/${filename}.css`, result.css)
6060
return result
6161
})
6262
.then((result) => {
6363
const minified = new CleanCSS().minify(result.css)
64-
fs.writeFileSync(`./demo/${filename}.min.css`, minified.styles)
64+
fs.writeFileSync(`./docs/${filename}.min.css`, minified.styles)
6565
})
6666
.catch((error) => {
6767
console.log(error)
@@ -70,6 +70,6 @@ function buildDemoFile(filename) {
7070

7171
console.info('Building CSS...')
7272

73-
Promise.all([buildDemoFile('tailwind')]).then(() => {
74-
console.log('Finished building demo CSS.')
73+
Promise.all([buildDocsFile('tailwind')]).then(() => {
74+
console.log('Finished building docs CSS.')
7575
})

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ module.exports = plugin.withOptions(function(options = {}) {
1111
currentScreenVar = options.currentScreenVar ?? '--current-screen',
1212
currentScreenDefault = options.currentScreenDefault ?? screenWidthDefault,
1313
paddingVar = options.paddingVar ?? '--container-padding',
14-
paddingDefault = theme('container.padding.DEFAULT', undefined)
14+
paddingDefault = typeof theme('container.padding') === 'string'
15+
? theme('container.padding')
16+
: theme('container.padding.DEFAULT', theme('container.padding.default'))
1517

1618

1719
/* Base */

0 commit comments

Comments
 (0)