---
url: /reference/packages/regex/src/namespaces/CssdocLocalPatterns/variables/HOST_CONTEXT.md
---
# Variable: HOST_CONTEXT

```ts
const HOST_CONTEXT: Regex<":host-context\\((?<selector>[^)]+)\\)", {
  flags: "u";
  names: {
     selector: string;
  };
}>;
```

Defined in: [packages/regex/src/tiers/cssdoc-local.ts:374](https://github.com/thedannywahl/cssdoc/blob/main/packages/regex/src/tiers/cssdoc-local.ts#L374)

Host Context Pseudo-Class Pattern
Matches `:host-context(selector)` for scoped host styling.
Used to extract ancestor context selector.

## Example

```ts
HOST_CONTEXT.exec(":host-context(.dark-mode)")?.groups?.selector // ".dark-mode"
```
