purgetss 6.2.32 → 6.2.34
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/bin/purgetss +8 -7
- package/index.js +18 -2
- package/lib/helpers.js +5 -1
- package/package.json +1 -1
package/bin/purgetss
CHANGED
|
@@ -70,14 +70,15 @@ program
|
|
|
70
70
|
.argument('[hexcode]', 'The base hexcode value')
|
|
71
71
|
.argument('[name]', 'Name of the color')
|
|
72
72
|
.option('-n, --name', 'Specify the name of the color')
|
|
73
|
-
.option('-q, --quotes', `Keep double quotes in
|
|
73
|
+
.option('-q, --quotes', `Keep double quotes in ${chalk.yellow('config.js')}`)
|
|
74
74
|
.option('-r, --random', 'Generate shades from a random color')
|
|
75
|
+
.option('-o, --override', `Place new shades in ${chalk.yellow('theme.colors')} to override default colors`)
|
|
75
76
|
.option('-s, --single', 'Generate a single color definition')
|
|
76
|
-
.option('-
|
|
77
|
-
.option('-
|
|
78
|
-
.option('-
|
|
79
|
-
.description(
|
|
80
|
-
.help(
|
|
77
|
+
.option('-l, --log', 'Log shades instead of saving them')
|
|
78
|
+
.option('-j, --json', `Log shades in ${chalk.yellow('app/config.json')} format`)
|
|
79
|
+
.option('-t, --tailwind', `Log shades in ${chalk.yellow('tailwind.config.js')} format`)
|
|
80
|
+
.description(`Generate color shades for ${chalk.yellow('config.js')} from a given hexcolor`)
|
|
81
|
+
.help(`Generate color shades from a hexcolor for your project. By default, the new shades are placed in ${chalk.yellow('theme.extend.colors')}`)
|
|
81
82
|
.action((args, options, logger) => {
|
|
82
83
|
purgetss.shades(args, options)
|
|
83
84
|
})
|
|
@@ -129,7 +130,7 @@ program
|
|
|
129
130
|
program
|
|
130
131
|
.command('build-fonts')
|
|
131
132
|
.alias('bf')
|
|
132
|
-
.description(`Generate
|
|
133
|
+
.description(`Generate ${chalk.yellow('fonts.tss')} from font and CSS files in ${chalk.yellow('./purgetss/fonts')}`)
|
|
133
134
|
.help(`Generate a ${chalk.yellow('./purgetss/styles/fonts.tss')} file based on the font and css files located in ${chalk.yellow('./purgetss/fonts')} folder`)
|
|
134
135
|
.option('-m, --module', `To also generate a CommonJS module in ${chalk.yellow('./app/lib/')} folder called ${chalk.yellow('purgetss-fonts.js')}`)
|
|
135
136
|
.action((args, options, logger) => {
|
package/index.js
CHANGED
|
@@ -429,8 +429,24 @@ function shades(args, options) {
|
|
|
429
429
|
|
|
430
430
|
const silent = options.tailwind || options.json || options.log
|
|
431
431
|
if (alloyProject(silent) && !silent) {
|
|
432
|
-
if (
|
|
433
|
-
|
|
432
|
+
if (options.override) {
|
|
433
|
+
if (!configFile.theme.colors) configFile.theme.colors = {}
|
|
434
|
+
configFile.theme.colors[colorObject.name] = colorObject.shades
|
|
435
|
+
|
|
436
|
+
if (configFile.theme.extend.colors) {
|
|
437
|
+
if (configFile.theme.extend.colors[colorObject.name]) delete configFile.theme.extend.colors[colorObject.name]
|
|
438
|
+
if (Object.keys(configFile.theme.extend.colors).length === 0) delete configFile.theme.extend.colors
|
|
439
|
+
}
|
|
440
|
+
} else {
|
|
441
|
+
if (!configFile.theme.extend.colors) configFile.theme.extend.colors = {}
|
|
442
|
+
configFile.theme.extend.colors[colorObject.name] = colorObject.shades
|
|
443
|
+
|
|
444
|
+
if (configFile.theme.colors) {
|
|
445
|
+
if (configFile.theme.colors[colorObject.name]) delete configFile.theme.colors[colorObject.name]
|
|
446
|
+
if (Object.keys(configFile.theme.colors).length === 0) delete configFile.theme.colors
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
434
450
|
fs.writeFileSync(projectsConfigJS, 'module.exports = ' + cleanDoubleQuotes(configFile, options), 'utf8', err => { throw err })
|
|
435
451
|
checkIfColorModule()
|
|
436
452
|
logger.info(`${chalk.hex(colorFamily.hexcode).bold(`“${colorFamily.name}”`)} (${chalk.bgHex(colorFamily.hexcode)(colorFamily.hexcode)}) saved in`, chalk.yellow('config.js'))
|
package/lib/helpers.js
CHANGED
|
@@ -6494,18 +6494,20 @@ const arbitraryValuesTable = {
|
|
|
6494
6494
|
'rounded-b': 'borderRadius: [0, 0, {value}, {value}]',
|
|
6495
6495
|
'rounded-bl': 'borderRadius: [0, 0, 0, {value}]',
|
|
6496
6496
|
'rounded-br': 'borderRadius: [0, 0, {value}, 0]',
|
|
6497
|
+
'rounded-full': 'width: {value}, height: {value}, borderRadius: {value1}',
|
|
6497
6498
|
'rounded-l': 'borderRadius: [{value}, 0, 0, {value}]',
|
|
6498
6499
|
'rounded-r': 'borderRadius: [0, {value}, {value}, 0]',
|
|
6499
6500
|
'rounded-t': 'borderRadius: [{value}, {value}, 0, 0]',
|
|
6500
6501
|
'rounded-tl': 'borderRadius: [{value}, 0, 0, 0]',
|
|
6501
6502
|
'rounded-tr': 'borderRadius: [0, {value}, 0, 0]',
|
|
6502
6503
|
'rounded': 'borderRadius: {value}',
|
|
6503
|
-
'rounded-full': 'width: {value}, height: {value}, borderRadius: {value1}',
|
|
6504
6504
|
'row-h': 'rowHeight: {value}',
|
|
6505
6505
|
'rw': 'rightWidth: {value}',
|
|
6506
6506
|
'section-header-top-padding': 'sectionHeaderTopPadding: {value}',
|
|
6507
6507
|
'separator-h': 'separatorHeight: {value}',
|
|
6508
6508
|
'shadow-radius': 'shadowRadius: {value}',
|
|
6509
|
+
'target-image-h': 'targetImageHeight: {value}',
|
|
6510
|
+
'target-image-w': 'targetImageWidth: {value}',
|
|
6509
6511
|
'top': 'top: {value}',
|
|
6510
6512
|
'w': 'width: {value}',
|
|
6511
6513
|
'wh': 'width: {value}, height: {value}',
|
|
@@ -6517,6 +6519,8 @@ const arbitraryValuesTable = {
|
|
|
6517
6519
|
// Color
|
|
6518
6520
|
'active-tint': 'activeTintColor: {value}',
|
|
6519
6521
|
'active-title': 'activeTitleColor: {value}',
|
|
6522
|
+
'badge-bg': 'badgeBackgroundColor: {value}',
|
|
6523
|
+
'badge-text': 'badgeTextColor: {value}',
|
|
6520
6524
|
'badge': 'badgeColor: {value}',
|
|
6521
6525
|
'bar': 'barColor: {value}',
|
|
6522
6526
|
'bg-disabled': 'backgroundDisabledColor: {value}',
|