cs
This commit is contained in:
12
node_modules/@ant-design/cssinjs/es/linters/contentQuotesLinter.js
generated
vendored
Normal file
12
node_modules/@ant-design/cssinjs/es/linters/contentQuotesLinter.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { lintWarning } from "./utils";
|
||||
var linter = function linter(key, value, info) {
|
||||
if (key === 'content') {
|
||||
// From emotion: https://github.com/emotion-js/emotion/blob/main/packages/serialize/src/index.js#L63
|
||||
var contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
||||
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
|
||||
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
||||
lintWarning("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(value, "\"'`."), info);
|
||||
}
|
||||
}
|
||||
};
|
||||
export default linter;
|
||||
Reference in New Issue
Block a user