File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,34 @@ module.exports = {
264264}
265265```
266266
267+ ### Set a value as string
268+ ``` js
269+ // tailwind.config.js
270+ module .exports = {
271+ theme: {
272+ extend: {
273+ fluidType: {
274+ values: {
275+ // ...
276+ ' 2xs' : ' 11px' ,
277+ // ...
278+ }
279+ }
280+ }
281+ }
282+ };
283+ ```
284+
285+ ``` html
286+ <p class =" text-2xs" >The quick brown fox jumps over the lazy dogs</p >
287+ ```
288+
289+ ``` css
290+ .text-2xs {
291+ font-size : 11px ;
292+ }
293+ ```
294+
267295### Set a prefix
268296
269297``` js
Original file line number Diff line number Diff line change 11{
22 "name" : " tailwindcss-fluid-type" ,
3- "version" : " 1.3.0 " ,
3+ "version" : " 1.3.1 " ,
44 "description" : " Bring fluid type to tailwindcss" ,
55 "main" : " src/index.js" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -65,9 +65,14 @@ module.exports = plugin(
6565 Object . entries ( values ) . map ( ( [ key , value ] ) => {
6666 let output = { } ;
6767
68- // Check if value a number
68+ // Check if value is a string
69+ if ( typeof value === 'string' ) {
70+ output . fontSize = value
71+ }
72+
73+ // Check if value is a number
6974 if ( Number . isInteger ( value ) ) {
70- output . fontSize = Number . isInteger ( value ) ? calcModularScale ( value ) : value
75+ output . fontSize = calcModularScale ( value )
7176 }
7277
7378 // Check if value is array with length 1
You can’t perform that action at this time.
0 commit comments