File tree 3 files changed +10
-9
lines changed
3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " tailwindcss-fluid-type" ,
3
- "version" : " v2.0.0-alpha.2 " ,
3
+ "version" : " v2.0.0-alpha.3 " ,
4
4
"description" : " Bring fluid type to tailwindcss" ,
5
5
"main" : " src/index.js" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change 1
1
const defaults = require ( "../config/defaults" ) ;
2
2
3
3
module . 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
12
12
const sFtUnit = typeof unit === 'string' ? unit : 'rem' ;
13
13
const ftMin = sFtMin * Math . pow ( sFtRMin , value ) ;
14
14
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) => {
12
12
13
13
// Add prefix
14
14
data . prefix = options . settings ?. prefix || defaults . settings ?. prefix || ''
15
+ data . unit = options . settings ?. unit || defaults . settings ?. unit || 'rem'
15
16
16
17
// Add number check
17
18
data . settingsAreNumbers = Object
You can’t perform that action at this time.
0 commit comments