From bed21ddc754253da091754b28f3806f082917083 Mon Sep 17 00:00:00 2001 From: Mayank <9084735+mayank99@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:11:29 -0400 Subject: [PATCH] docs: fix link to visitor type definitions --- website/pages/transforms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/pages/transforms.md b/website/pages/transforms.md index e64d1d9f..7441cb5d 100644 --- a/website/pages/transforms.md +++ b/website/pages/transforms.md @@ -12,7 +12,7 @@ Custom transforms have a build time cost: it can be around 2x slower to compile ## Visitors -Custom transforms are implemented by passing a `visitor` object to the Lightning CSS Node API. A visitor includes one or more functions which are called for specific value types such as `Rule`, `Property`, or `Length`. In general, you should try to be as specific as possible about the types of values you want to handle. This way, Lightning CSS needs to call into JS as infrequently as possible, with the smallest objects possible, which improves performance. See the [TypeScript definitions](https://github.com/parcel-bundler/lightningcss/blob/master/node/index.d.ts#L101-L129) for a full list of available visitor functions. +Custom transforms are implemented by passing a `visitor` object to the Lightning CSS Node API. A visitor includes one or more functions which are called for specific value types such as `Rule`, `Property`, or `Length`. In general, you should try to be as specific as possible about the types of values you want to handle. This way, Lightning CSS needs to call into JS as infrequently as possible, with the smallest objects possible, which improves performance. See the [TypeScript definitions](https://github.com/parcel-bundler/lightningcss/blob/eb49015cf887ae720b80a2856ccbdf61bf940ef1/node/index.d.ts#L184-L214) for a full list of available visitor functions. Visitors can return a new value to update it. Each visitor accepts a different type of value, and usually expects the same type in return. This example multiplies all lengths by 2: