diff --git a/package.json b/package.json index fe373baa..0304d2c1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/testing-library__jest-dom": "^5.9.1", "aria-query": "^5.0.0", "chalk": "^3.0.0", - "css": "^3.0.0", + "@adobe/css-tools": "^4.0.1", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.5.6", "lodash": "^4.17.15", diff --git a/src/utils.js b/src/utils.js index 2f07fb8e..cdbb1088 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,6 @@ import redent from 'redent' -import cssParse from 'css/lib/parse' import isEqual from 'lodash/isEqual' +import {parse} from '@adobe/css-tools' class GenericTypeError extends Error { constructor(expectedString, received, matcherFn, context) { @@ -100,7 +100,7 @@ class InvalidCSSError extends Error { } function parseCSS(css, ...args) { - const ast = cssParse(`selector { ${css} }`, {silent: true}).stylesheet + const ast = parse(`selector { ${css} }`, {silent: true}).stylesheet if (ast.parsingErrors && ast.parsingErrors.length > 0) { const {reason, line} = ast.parsingErrors[0]