Skip to content

Commit 7f73608

Browse files
authored
Improve warning messages (#9608)
* drop experimental log * reword some warning messages
1 parent ea5b11c commit 7f73608

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/corePlugins.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ export let variantPlugins = {
159159
matchVariant(
160160
name,
161161
(value = '', extra) => {
162-
if (extra.modifier) {
163-
log.warn(`modifier-${name}-experimental`, [
164-
`The ${name} variant modifier feature in Tailwind CSS is currently in preview.`,
165-
'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
166-
])
167-
}
168-
169162
let result = normalize(typeof value === 'function' ? value(extra) : value)
170163
if (!result.includes('&')) result = '&' + result
171164

@@ -309,19 +302,19 @@ export let variantPlugins = {
309302
return (value) => {
310303
if (!areSimpleScreens) {
311304
log.warn('complex-screen-config', [
312-
'The min and max variants are not supported with a screen configuration containing objects.',
305+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects.',
313306
])
314307

315308
return []
316309
} else if (!screensUseConsistentUnits) {
317310
log.warn('mixed-screen-units', [
318-
'The min and max variants are not supported with a screen configuration containing mixed units.',
311+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
319312
])
320313

321314
return []
322315
} else if (typeof value === 'string' && !canUseUnits(value)) {
323316
log.warn('minmax-have-mixed-units', [
324-
'The min and max variants are not supported with a screen configuration containing mixed units.',
317+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
325318
])
326319

327320
return []

src/lib/findAtConfigPath.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ export function findAtConfigPath(root, result) {
1616

1717
if (relativeTo === null) {
1818
throw rule.error(
19-
'The `@config` at-rule cannot be used without a `from` option being set on the PostCSS config.'
19+
'The `@config` directive cannot be used without setting `from` in your PostCSS config.'
2020
)
2121
}
2222

2323
if (configPath) {
24-
throw rule.error('Only `@config` at-rule is allowed per file.')
24+
throw rule.error('Only one `@config` directive is allowed per file.')
2525
}
2626

2727
let matches = rule.params.match(/(['"])(.*?)\1/)
2828
if (!matches) {
29-
throw rule.error(
30-
'The `@config` at-rule must be followed by a string containing the path to the config file.'
31-
)
29+
throw rule.error('A path is required when using the `@config` directive.')
3230
}
3331

3432
let inputPath = matches[2]
3533
if (path.isAbsolute(inputPath)) {
36-
throw rule.error('The `@config` at-rule cannot be used with an absolute path.')
34+
throw rule.error('The `@config` directive cannot be used with an absolute path.')
3735
}
3836

3937
configPath = path.resolve(path.dirname(relativeTo), inputPath)

0 commit comments

Comments
 (0)