Skip to content

Commit

Permalink
Add background-origin utilities (#4117)
Browse files Browse the repository at this point in the history
* Add background-origin utilities

* Update fixtures

* Update basic usage test

* Change sort order for background origin

* Move background origin after other background properties
  • Loading branch information
David Luhr authored and adamwathan committed Apr 23, 2021
1 parent 2e01cd8 commit 4114c0b
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 4 deletions.
74 changes: 73 additions & 1 deletion __tests__/fixtures/tailwind-output-flagged.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

Expand Down Expand Up @@ -7862,6 +7862,18 @@ video {
background-size: contain;
}

.bg-origin-border {
background-origin: border-box;
}

.bg-origin-padding {
background-origin: padding-box;
}

.bg-origin-content {
background-origin: content-box;
}

.border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -37108,6 +37120,18 @@ video {
background-size: contain;
}

.sm\:bg-origin-border {
background-origin: border-box;
}

.sm\:bg-origin-padding {
background-origin: padding-box;
}

.sm\:bg-origin-content {
background-origin: content-box;
}

.sm\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -66219,6 +66243,18 @@ video {
background-size: contain;
}

.md\:bg-origin-border {
background-origin: border-box;
}

.md\:bg-origin-padding {
background-origin: padding-box;
}

.md\:bg-origin-content {
background-origin: content-box;
}

.md\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -95330,6 +95366,18 @@ video {
background-size: contain;
}

.lg\:bg-origin-border {
background-origin: border-box;
}

.lg\:bg-origin-padding {
background-origin: padding-box;
}

.lg\:bg-origin-content {
background-origin: content-box;
}

.lg\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -124441,6 +124489,18 @@ video {
background-size: contain;
}

.xl\:bg-origin-border {
background-origin: border-box;
}

.xl\:bg-origin-padding {
background-origin: padding-box;
}

.xl\:bg-origin-content {
background-origin: content-box;
}

.xl\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -153552,6 +153612,18 @@ video {
background-size: contain;
}

.\32xl\:bg-origin-border {
background-origin: border-box;
}

.\32xl\:bg-origin-padding {
background-origin: padding-box;
}

.\32xl\:bg-origin-content {
background-origin: content-box;
}

.\32xl\:border-collapse {
border-collapse: collapse;
}
Expand Down
74 changes: 73 additions & 1 deletion __tests__/fixtures/tailwind-output-important.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

Expand Down Expand Up @@ -7862,6 +7862,18 @@ video {
background-size: contain !important;
}

.bg-origin-border {
background-origin: border-box !important;
}

.bg-origin-padding {
background-origin: padding-box !important;
}

.bg-origin-content {
background-origin: content-box !important;
}

.border-collapse {
border-collapse: collapse !important;
}
Expand Down Expand Up @@ -37108,6 +37120,18 @@ video {
background-size: contain !important;
}

.sm\:bg-origin-border {
background-origin: border-box !important;
}

.sm\:bg-origin-padding {
background-origin: padding-box !important;
}

.sm\:bg-origin-content {
background-origin: content-box !important;
}

.sm\:border-collapse {
border-collapse: collapse !important;
}
Expand Down Expand Up @@ -66219,6 +66243,18 @@ video {
background-size: contain !important;
}

.md\:bg-origin-border {
background-origin: border-box !important;
}

.md\:bg-origin-padding {
background-origin: padding-box !important;
}

.md\:bg-origin-content {
background-origin: content-box !important;
}

.md\:border-collapse {
border-collapse: collapse !important;
}
Expand Down Expand Up @@ -95330,6 +95366,18 @@ video {
background-size: contain !important;
}

.lg\:bg-origin-border {
background-origin: border-box !important;
}

.lg\:bg-origin-padding {
background-origin: padding-box !important;
}

.lg\:bg-origin-content {
background-origin: content-box !important;
}

.lg\:border-collapse {
border-collapse: collapse !important;
}
Expand Down Expand Up @@ -124441,6 +124489,18 @@ video {
background-size: contain !important;
}

.xl\:bg-origin-border {
background-origin: border-box !important;
}

.xl\:bg-origin-padding {
background-origin: padding-box !important;
}

.xl\:bg-origin-content {
background-origin: content-box !important;
}

.xl\:border-collapse {
border-collapse: collapse !important;
}
Expand Down Expand Up @@ -153552,6 +153612,18 @@ video {
background-size: contain !important;
}

.\32xl\:bg-origin-border {
background-origin: border-box !important;
}

.\32xl\:bg-origin-padding {
background-origin: padding-box !important;
}

.\32xl\:bg-origin-content {
background-origin: content-box !important;
}

.\32xl\:border-collapse {
border-collapse: collapse !important;
}
Expand Down
74 changes: 73 additions & 1 deletion __tests__/fixtures/tailwind-output-no-color-opacity.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

Expand Down Expand Up @@ -7010,6 +7010,18 @@ video {
background-size: contain;
}

.bg-origin-border {
background-origin: border-box;
}

.bg-origin-padding {
background-origin: padding-box;
}

.bg-origin-content {
background-origin: content-box;
}

.border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -33700,6 +33712,18 @@ video {
background-size: contain;
}

.sm\:bg-origin-border {
background-origin: border-box;
}

.sm\:bg-origin-padding {
background-origin: padding-box;
}

.sm\:bg-origin-content {
background-origin: content-box;
}

.sm\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -60255,6 +60279,18 @@ video {
background-size: contain;
}

.md\:bg-origin-border {
background-origin: border-box;
}

.md\:bg-origin-padding {
background-origin: padding-box;
}

.md\:bg-origin-content {
background-origin: content-box;
}

.md\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -86810,6 +86846,18 @@ video {
background-size: contain;
}

.lg\:bg-origin-border {
background-origin: border-box;
}

.lg\:bg-origin-padding {
background-origin: padding-box;
}

.lg\:bg-origin-content {
background-origin: content-box;
}

.lg\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -113365,6 +113413,18 @@ video {
background-size: contain;
}

.xl\:bg-origin-border {
background-origin: border-box;
}

.xl\:bg-origin-padding {
background-origin: padding-box;
}

.xl\:bg-origin-content {
background-origin: content-box;
}

.xl\:border-collapse {
border-collapse: collapse;
}
Expand Down Expand Up @@ -139920,6 +139980,18 @@ video {
background-size: contain;
}

.\32xl\:bg-origin-border {
background-origin: border-box;
}

.\32xl\:bg-origin-padding {
background-origin: padding-box;
}

.\32xl\:bg-origin-content {
background-origin: content-box;
}

.\32xl\:border-collapse {
border-collapse: collapse;
}
Expand Down
Loading

0 comments on commit 4114c0b

Please sign in to comment.