Skip to content

Commit 74d133e

Browse files
committed
Update readme for v1.x
1 parent beac54c commit 74d133e

File tree

1 file changed

+73
-23
lines changed

1 file changed

+73
-23
lines changed

readme.md

Lines changed: 73 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,84 @@ yarn add -D tailwindcss-text-fill-stroke
1919

2020
## Usage
2121

22-
By default the plugin uses the `borderColors` and `borderWidths` properties from the config file to generate all of its classes. You can change that to whatever, just keep in mind if you have a `default` key in both objects, `.text-stroke` will set both the `-webkit-stroke-color` and `-webkit-stroke-width` of the element.
22+
By default the plugin uses the `borderColor` and `borderWidth` properties from your theme to generate all of its classes. You can change that to whatever, just keep in mind if you have a `default` key in both objects, `.text-stroke` will set both the `-webkit-stroke-color` and `-webkit-stroke-width` of the element.
2323

2424
```js
25-
require('tailwindcss-text-fill-stroke')({
26-
colors: {
27-
'red': 'red',
28-
'green': 'green',
29-
'blue': 'blue',
25+
// tailwind.config.js
26+
{
27+
theme: { // defaults to these values
28+
textFillColor: theme => theme('borderColor'),
29+
textStrokeColor: theme => theme('borderColor'),
30+
textStrokeWidth: theme => theme('borderWidth'),
31+
paintOrder: {
32+
'fsm': { paintOrder: 'fill, stroke, markers' },
33+
'fms': { paintOrder: 'fill, markers, stroke' },
34+
'sfm': { paintOrder: 'stroke, fill, markers' },
35+
'smf': { paintOrder: 'stroke, markers, fill' },
36+
'mfs': { paintOrder: 'markers, fill, stroke' },
37+
'msf': { paintOrder: 'markers, stroke, fill' },
38+
},
3039
},
31-
widths: {
32-
default: '1px',
33-
'sm': '2px',
34-
'md': '4px',
35-
'lg': '8px',
40+
41+
variants: { // all the following default to ['responsive']
42+
textFillColor: ['responsive'],
43+
textStrokeColor: ['responsive'],
44+
textStrokeWidth: ['responsive'],
45+
paintOrder: ['responsive'],
3646
},
37-
variants: [],
38-
}),
47+
48+
plugins: [
49+
require('tailwindcss-blend-mode'), // no options to configure
50+
],
51+
}
3952
```
4053

4154
```css
42-
.text-fill-red { -webkit-text-fill-color: red; }
43-
.text-stroke-red { -webkit-text-stroke-color: red; }
44-
.text-fill-blue { -webkit-text-fill-color: blue; }
45-
.text-stroke-blue { -webkit-text-stroke-color: blue; }
46-
.text-fill-green { -webkit-text-fill-color: green; }
47-
.text-stroke-green { -webkit-text-stroke-color: green; }
48-
.text-stroke { -webkit-text-stroke-width: 1px; }
49-
.text-stroke-sm { -webkit-text-stroke-width: 2px; }
50-
.text-stroke-md { -webkit-text-stroke-width: 4px; }
51-
.text-stroke-lg { -webkit-text-stroke-width: 8px; }
55+
.text-fill-transparent { text-fill-color: transparent }
56+
.text-fill-black { text-fill-color: #000 }
57+
.text-fill-white { text-fill-color: #fff }
58+
.text-fill { text-fill-color: #e0e0e0 }
59+
60+
.text-stroke-transparent { text-stroke-color: transparent }
61+
.text-stroke-black { text-stroke-color: #000 }
62+
.text-stroke-white { text-stroke-color: #fff }
63+
.text-stroke { text-stroke-color: #e0e0e0 }
64+
65+
.text-stroke-0 { text-stroke-width: 0 }
66+
.text-stroke-2 { text-stroke-width: 2px }
67+
.text-stroke-4 { text-stroke-width: 4px }
68+
.text-stroke-8 { text-stroke-width: 8px }
69+
.text-stroke { text-stroke-width: 1px }
70+
71+
.paint-fsm { paint-order: fill, stroke, markers }
72+
.paint-fms { paint-order: fill, markers, stroke }
73+
.paint-sfm { paint-order: stroke, fill, markers }
74+
.paint-smf { paint-order: stroke, markers, fill }
75+
.paint-mfs { paint-order: markers, fill, stroke }
76+
.paint-msf { paint-order: markers, stroke, fill }
77+
78+
@media (min-width: 640px) {
79+
.sm\:text-fill-transparent { text-fill-color: transparent }
80+
.sm\:text-fill-black { text-fill-color: #000 }
81+
.sm\:text-fill-white { text-fill-color: #fff }
82+
.sm\:text-fill { text-fill-color: #e0e0e0 }
83+
84+
.sm\:text-stroke-transparent { text-stroke-color: transparent }
85+
.sm\:text-stroke-black { text-stroke-color: #000 }
86+
.sm\:text-stroke-white { text-stroke-color: #fff }
87+
.sm\:text-stroke { text-stroke-color: #e0e0e0 }
88+
89+
.sm\:text-stroke-0 { text-stroke-width: 0 }
90+
.sm\:text-stroke-2 { text-stroke-width: 2px }
91+
.sm\:text-stroke-4 { text-stroke-width: 4px }
92+
.sm\:text-stroke-8 { text-stroke-width: 8px }
93+
.sm\:text-stroke { text-stroke-width: 1px }
94+
95+
.sm\:paint-fsm { paint-order: fill, stroke, markers }
96+
.sm\:paint-fms { paint-order: fill, markers, stroke }
97+
.sm\:paint-sfm { paint-order: stroke, fill, markers }
98+
.sm\:paint-smf { paint-order: stroke, markers, fill }
99+
.sm\:paint-mfs { paint-order: markers, fill, stroke }
100+
.sm\:paint-msf { paint-order: markers, stroke, fill }
101+
}
52102
```

0 commit comments

Comments
 (0)