芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/public_html/node_modules/tailwindcss/src/util/validateFormalSyntax.js
import { length, percentage } from './dataTypes' import { splitAtTopLevelOnly } from './splitAtTopLevelOnly' /** * * https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#formal_syntax * * background-size = *
# * *
= * [
| auto ]{1,2} | * cover | * contain * *
= *
| *
* * @param {string} value */ export function backgroundSize(value) { let keywordValues = ['cover', 'contain'] // the
type will probably be a css function // so we have to use `splitAtTopLevelOnly` return splitAtTopLevelOnly(value, ',').every((part) => { let sizes = splitAtTopLevelOnly(part, '_').filter(Boolean) if (sizes.length === 1 && keywordValues.includes(sizes[0])) return true if (sizes.length !== 1 && sizes.length !== 2) return false return sizes.every((size) => length(size) || percentage(size) || size === 'auto') }) }