purgetss 7.1.7 → 7.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/purgetss.ui.js
CHANGED
|
@@ -109,7 +109,7 @@ function processTitaniumRules(_propertiesOnly) {
|
|
|
109
109
|
_.each(_propertiesOnly, (value, key) => {
|
|
110
110
|
const property = `\n// Property: ${key}\n`
|
|
111
111
|
const description = `// Description: ${value.description.replace(/\n/g, ' ')}\n`
|
|
112
|
-
customRules += property + description + helpers.customRules(value.base, key)
|
|
112
|
+
customRules += property + description + helpers.customRules(value.base, key, false)
|
|
113
113
|
})
|
|
114
114
|
|
|
115
115
|
helpers.globalOptions.legacy = currentLegacyOption
|
package/package.json
CHANGED
|
@@ -166,7 +166,7 @@ export function parseValue(value, sign = '') {
|
|
|
166
166
|
* @param {string} rule - Optional rule parameter
|
|
167
167
|
* @returns {string} Modified class name
|
|
168
168
|
*/
|
|
169
|
-
export function setModifier2(modifier, rule = null) {
|
|
169
|
+
export function setModifier2(modifier, rule = null, changeToDash = true) {
|
|
170
170
|
if (defaultModifier(modifier)) {
|
|
171
171
|
modifier = ''
|
|
172
172
|
} else if (modifier === 'ios') {
|
|
@@ -183,7 +183,9 @@ export function setModifier2(modifier, rule = null) {
|
|
|
183
183
|
modifier = `${modifier}-`
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
if (changeToDash) {
|
|
187
|
+
modifier = camelCaseToDash(modifier)
|
|
188
|
+
}
|
|
187
189
|
|
|
188
190
|
return modifier
|
|
189
191
|
}
|
|
@@ -378,22 +380,22 @@ export function fixInvalidValues(invalidValues, currentValue) {
|
|
|
378
380
|
* @param {string} _key - Key for the rule
|
|
379
381
|
* @returns {string} Generated styles string
|
|
380
382
|
*/
|
|
381
|
-
export function customRules(_value, _key) {
|
|
383
|
+
export function customRules(_value, _key, changeToDash = false) {
|
|
382
384
|
// ! Want to refactor
|
|
383
385
|
let convertedStyles = ''
|
|
384
386
|
|
|
385
387
|
_.each(_value, (value, modifier) => {
|
|
386
388
|
if (modifier === 'apply') {
|
|
387
|
-
_applyClasses[setModifier2(_key)] = new Set(Array.isArray(_value[modifier]) ? _value[modifier] : _value[modifier].split(' '))
|
|
389
|
+
_applyClasses[setModifier2(_key, null, changeToDash)] = new Set(Array.isArray(_value[modifier]) ? _value[modifier] : _value[modifier].split(' '))
|
|
388
390
|
|
|
389
|
-
convertedStyles += `'${setModifier2(_key)}': { {_applyProperties_} }\n`
|
|
391
|
+
convertedStyles += `'${setModifier2(_key, null, changeToDash)}': { {_applyProperties_} }\n`
|
|
390
392
|
} else {
|
|
391
393
|
let customProperties = ''
|
|
392
394
|
|
|
393
395
|
_.each(value, (theValue, theModifier) => {
|
|
394
396
|
if (typeof (theValue) === 'object' && theValue !== null) {
|
|
395
397
|
if (theModifier === 'apply') {
|
|
396
|
-
_applyClasses[`${setModifier2(_key, modifier)}`] = new Set(Array.isArray(theValue) ? theValue : theValue.split(' '))
|
|
398
|
+
_applyClasses[`${setModifier2(_key, modifier, changeToDash)}`] = new Set(Array.isArray(theValue) ? theValue : theValue.split(' '))
|
|
397
399
|
|
|
398
400
|
customProperties += ' {_applyProperties_},'
|
|
399
401
|
} else {
|
|
@@ -421,7 +423,7 @@ export function customRules(_value, _key) {
|
|
|
421
423
|
}
|
|
422
424
|
} else {
|
|
423
425
|
if (theModifier === 'apply') {
|
|
424
|
-
_applyClasses[`${setModifier2(_key, modifier)}${setModifier2(modifier)}`] = new Set(Array.isArray(theValue) ? theValue : theValue.split(' '))
|
|
426
|
+
_applyClasses[`${setModifier2(_key, modifier, changeToDash)}${setModifier2(modifier, null, changeToDash)}`] = new Set(Array.isArray(theValue) ? theValue : theValue.split(' '))
|
|
425
427
|
|
|
426
428
|
customProperties += ' {_applyProperties_},'
|
|
427
429
|
} else {
|
|
@@ -430,7 +432,7 @@ export function customRules(_value, _key) {
|
|
|
430
432
|
}
|
|
431
433
|
})
|
|
432
434
|
|
|
433
|
-
convertedStyles += `'${setModifier2(_key, modifier)}${setModifier2(modifier)}': {${removeLastCharacter(customProperties)} }\n`
|
|
435
|
+
convertedStyles += `'${setModifier2(_key, modifier, changeToDash)}${setModifier2(modifier, null, changeToDash)}': {${removeLastCharacter(customProperties)} }\n`
|
|
434
436
|
}
|
|
435
437
|
})
|
|
436
438
|
|