File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " tailwindcss-fluid-type" ,
3- "version" : " v2.0.0-alpha.2 " ,
3+ "version" : " v2.0.0-alpha.3 " ,
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 11const defaults = require ( "../config/defaults" ) ;
22
33module . exports = ( value , data ) => {
4- if ( data . settingsAreNumbers && data . settings && defaults . settings ) {
5- const sFtMin = data . settings ?. fontSizeMin || defaults . settings ?. fontSizeMin
6- const sFtMax = data . settings ?. fontSizeMax || defaults . settings ?. fontSizeMax
7- const sFtRMin = data . settings ?. ratioMin || defaults . settings ?. ratioMin
8- const sFtRMax = data . settings ?. ratioMax || defaults . settings ?. ratioMax
9- const sFtSMin = data . settings ?. screenMin || defaults . settings ?. screenMin
10- const sFtSMax = data . settings ?. screenMax || defaults . settings ?. screenMax
11- const unit = data . settings ?. unit || defaults . settings ?. unit
4+ if ( data . settingsAreNumbers && data . settings ) {
5+ const sFtMin = data . settings ?. fontSizeMin
6+ const sFtMax = data . settings ?. fontSizeMax
7+ const sFtRMin = data . settings ?. ratioMin
8+ const sFtRMax = data . settings ?. ratioMax
9+ const sFtSMin = data . settings ?. screenMin
10+ const sFtSMax = data . settings ?. screenMax
11+ const unit = data . unit
1212 const sFtUnit = typeof unit === 'string' ? unit : 'rem' ;
1313 const ftMin = sFtMin * Math . pow ( sFtRMin , value ) ;
1414 const ftMax = sFtMax * Math . pow ( sFtRMax , value ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ module.exports = (options, data) => {
1212
1313 // Add prefix
1414 data . prefix = options . settings ?. prefix || defaults . settings ?. prefix || ''
15+ data . unit = options . settings ?. unit || defaults . settings ?. unit || 'rem'
1516
1617 // Add number check
1718 data . settingsAreNumbers = Object
You can’t perform that action at this time.
0 commit comments