Skip to content

Commit

Permalink
fix: migrate ccs v3 to @adobe/css-tools v4 (#470)
Browse files Browse the repository at this point in the history
Co-authored-by: Jean-Philippe Zolesio <zolesio@adobe.com>
  • Loading branch information
holblin and Jean-Philippe Zolesio committed Aug 4, 2022
1 parent af18453 commit 948d90f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 948d90f

Please sign in to comment.