---
url: /reference/packages/regex/src/namespaces/CssSpecPatterns/variables/CSS_HASH_COLOR.md
---
# Variable: CSS_HASH_COLOR

```ts
const CSS_HASH_COLOR: Regex<"#(?<color>[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?)", {
  names: {
     color: string;
  };
}>;
```

Defined in: [packages/regex/src/tiers/css-spec.ts:102](https://github.com/thedannywahl/cssdoc/blob/main/packages/regex/src/tiers/css-spec.ts#L102)

CSS hash color from W3C formal grammar.

# followed by 3 or 6 hexadecimal digits.

## Example

```ts
CSS_HASH_COLOR.exec("#fff")?.groups?.color // "fff"
CSS_HASH_COLOR.exec("#ffffff")?.groups?.color // "ffffff"
```
