Skip to content

Commit b50b8d4

Browse files
MichaelDeBoeyadamwathan
authored andcommitted
Add background repeat utilities
1 parent ed550b3 commit b50b8d4

File tree

6 files changed

+131
-0
lines changed

6 files changed

+131
-0
lines changed

__tests__/fixtures/tailwind-output.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,22 @@ button,
12471247
background-position: top;
12481248
}
12491249

1250+
.bg-repeat {
1251+
background-repeat: repeat;
1252+
}
1253+
1254+
.bg-no-repeat {
1255+
background-repeat: no-repeat;
1256+
}
1257+
1258+
.bg-repeat-x {
1259+
background-repeat: repeat-x;
1260+
}
1261+
1262+
.bg-repeat-y {
1263+
background-repeat: repeat-y;
1264+
}
1265+
12501266
.bg-cover {
12511267
background-size: cover;
12521268
}
@@ -5102,6 +5118,22 @@ button,
51025118
background-position: top;
51035119
}
51045120

5121+
.sm\:bg-repeat {
5122+
background-repeat: repeat;
5123+
}
5124+
5125+
.sm\:bg-no-repeat {
5126+
background-repeat: no-repeat;
5127+
}
5128+
5129+
.sm\:bg-repeat-x {
5130+
background-repeat: repeat-x;
5131+
}
5132+
5133+
.sm\:bg-repeat-y {
5134+
background-repeat: repeat-y;
5135+
}
5136+
51055137
.sm\:bg-cover {
51065138
background-size: cover;
51075139
}
@@ -8958,6 +8990,22 @@ button,
89588990
background-position: top;
89598991
}
89608992

8993+
.md\:bg-repeat {
8994+
background-repeat: repeat;
8995+
}
8996+
8997+
.md\:bg-no-repeat {
8998+
background-repeat: no-repeat;
8999+
}
9000+
9001+
.md\:bg-repeat-x {
9002+
background-repeat: repeat-x;
9003+
}
9004+
9005+
.md\:bg-repeat-y {
9006+
background-repeat: repeat-y;
9007+
}
9008+
89619009
.md\:bg-cover {
89629010
background-size: cover;
89639011
}
@@ -12814,6 +12862,22 @@ button,
1281412862
background-position: top;
1281512863
}
1281612864

12865+
.lg\:bg-repeat {
12866+
background-repeat: repeat;
12867+
}
12868+
12869+
.lg\:bg-no-repeat {
12870+
background-repeat: no-repeat;
12871+
}
12872+
12873+
.lg\:bg-repeat-x {
12874+
background-repeat: repeat-x;
12875+
}
12876+
12877+
.lg\:bg-repeat-y {
12878+
background-repeat: repeat-y;
12879+
}
12880+
1281712881
.lg\:bg-cover {
1281812882
background-size: cover;
1281912883
}
@@ -16670,6 +16734,22 @@ button,
1667016734
background-position: top;
1667116735
}
1667216736

16737+
.xl\:bg-repeat {
16738+
background-repeat: repeat;
16739+
}
16740+
16741+
.xl\:bg-no-repeat {
16742+
background-repeat: no-repeat;
16743+
}
16744+
16745+
.xl\:bg-repeat-x {
16746+
background-repeat: repeat-x;
16747+
}
16748+
16749+
.xl\:bg-repeat-y {
16750+
background-repeat: repeat-y;
16751+
}
16752+
1667316753
.xl\:bg-cover {
1667416754
background-size: cover;
1667516755
}

defaultConfig.stub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ module.exports = {
776776
backgroundAttachment: ['responsive'],
777777
backgroundColors: ['responsive', 'hover'],
778778
backgroundPosition: ['responsive'],
779+
backgroundRepeat: ['responsive'],
779780
backgroundSize: ['responsive'],
780781
borderColors: ['responsive', 'hover'],
781782
borderRadius: ['responsive'],

docs/navigation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'Backgrounds' => [
1818
'Color' => 'background-color',
1919
'Position' => 'background-position',
20+
'Repeat' => 'background-repeat',
2021
'Size' => 'background-size',
2122
'Attachment' => 'background-attachment',
2223
],
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
extends: _layouts.documentation
3+
title: "Background Repeat"
4+
description: "Utilities for controlling the repetition of an element's background image."
5+
features:
6+
responsive: true
7+
customizable: false
8+
hover: false
9+
focus: false
10+
---
11+
12+
@include('_partials.work-in-progress')
13+
14+
@include('_partials.class-table', [
15+
'rows' => [
16+
[
17+
'.bg-repeat',
18+
'background-repeat: repeat;',
19+
'Repeat the background image both vertically and horizontally.',
20+
],
21+
[
22+
'.bg-no-repeat',
23+
'background-repeat: no-repeat;',
24+
'Don\'t repeat the background image.',
25+
],
26+
[
27+
'.bg-repeat-x',
28+
'background-repeat: repeat-x;',
29+
'Repeat the background image only horizontally.',
30+
],
31+
[
32+
'.bg-repeat-y',
33+
'background-repeat: repeat-y;',
34+
'Repeat the background image only vertically.',
35+
],
36+
]
37+
])

src/generators/backgroundRepeat.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import defineClasses from '../util/defineClasses'
2+
3+
export default function() {
4+
return defineClasses({
5+
'bg-repeat': { 'background-repeat': 'repeat' },
6+
'bg-no-repeat': { 'background-repeat': 'no-repeat' },
7+
'bg-repeat-x': { 'background-repeat': 'repeat-x' },
8+
'bg-repeat-y': { 'background-repeat': 'repeat-y' },
9+
})
10+
}

src/utilityModules.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import appearance from './generators/appearance'
33
import backgroundAttachment from './generators/backgroundAttachment'
44
import backgroundColors from './generators/backgroundColors'
55
import backgroundPosition from './generators/backgroundPosition'
6+
import backgroundRepeat from './generators/backgroundRepeat'
67
import backgroundSize from './generators/backgroundSize'
78
import borderColors from './generators/borderColors'
89
import borderRadius from './generators/borderRadius'
@@ -47,6 +48,7 @@ export default [
4748
{ name: 'backgroundAttachment', generator: backgroundAttachment },
4849
{ name: 'backgroundColors', generator: backgroundColors },
4950
{ name: 'backgroundPosition', generator: backgroundPosition },
51+
{ name: 'backgroundRepeat', generator: backgroundRepeat },
5052
{ name: 'backgroundSize', generator: backgroundSize },
5153
{ name: 'borderColors', generator: borderColors },
5254
{ name: 'borderRadius', generator: borderRadius },

0 commit comments

Comments
 (0)