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

[Home](./index.md) &gt; [@csstools/media-query-list-parser](./media-query-list-parser.md) &gt; [parseCustomMediaFromTokens](./media-query-list-parser.parsecustommediafromtokens.md)

## parseCustomMediaFromTokens() function

**Signature:**

```typescript
export declare function parseCustomMediaFromTokens(tokens: Array<CSSToken>, options?: {
    preserveInvalidMediaQueries?: boolean;
    onParseError?: (error: ParseError) => void;
}): CustomMedia | false;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

tokens


</td><td>

Array&lt;CSSToken&gt;


</td><td>


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

options


</td><td>

{ preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) =&gt; void; }


</td><td>

_(Optional)_


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

**Returns:**

[CustomMedia](./media-query-list-parser.custommedia.md) \| false

