From 26600dfdbfda645473e3e67643670ffc727c4fdf Mon Sep 17 00:00:00 2001 From: Bart Veneman Date: Mon, 19 Jan 2026 00:07:25 +0100 Subject: [PATCH] fix: update css-parser to format keyframes selectors --- index.ts | 1 + package-lock.json | 8 ++++---- package.json | 2 +- test/selectors.test.ts | 17 +++++++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index f2918f8..a4e790e 100644 --- a/index.ts +++ b/index.ts @@ -10,6 +10,7 @@ import { ATTR_FLAG_CASE_INSENSITIVE, ATTR_FLAG_CASE_SENSITIVE, NODE_TYPES as NODE, + DIMENSION, } from '@projectwallace/css-parser' const SPACE = ' ' diff --git a/package-lock.json b/package-lock.json index 6dad5e5..aa3d402 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.2.0", "license": "MIT", "dependencies": { - "@projectwallace/css-parser": "^0.12.2" + "@projectwallace/css-parser": "^0.12.3" }, "devDependencies": { "@codecov/vite-plugin": "^1.9.1", @@ -1150,9 +1150,9 @@ } }, "node_modules/@projectwallace/css-parser": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@projectwallace/css-parser/-/css-parser-0.12.2.tgz", - "integrity": "sha512-9CgD1jbu1hW/lde7okEbiL1DxpRVh0zQPf19RZdcHA+lTPqCS099ZoMtsnIgC/o6PnmAawii6wZExTwlOOqGPA==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/@projectwallace/css-parser/-/css-parser-0.12.3.tgz", + "integrity": "sha512-ZET2NGXZpqHHQmjV9sVIc0Vmgn8v2Xtg8KejKDNhKNsqGySyNMBJrIEEMhkofqrNU72zxaNubfVf4nk+F9dBJA==", "license": "MIT" }, "node_modules/@publint/pack": { diff --git a/package.json b/package.json index 47f8dbf..5f777cd 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,6 @@ "singleQuote": true }, "dependencies": { - "@projectwallace/css-parser": "^0.12.2" + "@projectwallace/css-parser": "^0.12.3" } } diff --git a/test/selectors.test.ts b/test/selectors.test.ts index e30f329..32cfc60 100644 --- a/test/selectors.test.ts +++ b/test/selectors.test.ts @@ -214,6 +214,23 @@ test(`formats ::highlight and ::highlight(Name) correctly`, () => { expect(actual).toEqual(expected) }) +test('formats keyframes selectors (50%) correctly', () => { + let actual = format( + `@keyframes Toastify__bounceInUp { 0% {animation-timing-function: cubic-bezier(.215, .61, .355, 1);} 50% {} 80%,to {} }`, + ) + let expected = `@keyframes Toastify__bounceInUp { + 0% { + animation-timing-function: cubic-bezier(.215, .61, .355, 1); + } + + 50% {} + + 80%, + to {} +}` + expect(actual).toBe(expected) +}) + test('formats unknown pseudos correctly', () => { let actual = format(` ::foo-bar,