<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@csstools/css-tokenizer](./css-tokenizer.md) &gt; [mutateUnit](./css-tokenizer.mutateunit.md)

## mutateUnit() function

Set the unit and update the string representation. This handles escaping.

**Signature:**

```typescript
export declare function mutateUnit(ident: TokenDimension, newUnit: string): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

ident


</td><td>

[TokenDimension](./css-tokenizer.tokendimension.md)


</td><td>


</td></tr>
<tr><td>

newUnit


</td><td>

string


</td><td>


</td></tr>
</tbody></table>

**Returns:**

void

