---
url: /reference/@cssdoc/core/interfaces/ModifierConvention.md
---
# Interface: ModifierConvention

Defined in: [packages/core/src/modifier.ts:26](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L26)

How a modifier attaches to a component's base class.

* `chained` — a separate class on the base element: `.base.primary` (bare/OOCSS), `.base.-mod`
  (rscss), `.base.is-open` (state). `separator` is the required class prefix (`""` = any chained
  class, `-`, `is-`).
* `suffix` — appended into the base class name itself: `.button--primary` (BEM/SUIT). `separator` is
  the delimiter between the base and the modifier body (`--`).
* `attribute` — an attribute selector on the base element: `.card[data-variant="ghost"]` (CUBE).
  `separator` is the required attribute-name prefix (`data-`; `""` = any attribute).

## Properties

### elementSeparator?

```ts
elementSeparator?: string | string[];
```

Defined in: [packages/core/src/modifier.ts:40](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L40)

The delimiter that marks a **BEM-style element** inside the base class name (e.g. `"__"` in
`.block__element`). When set (`suffix` structure only), a matching class is recorded as a
[part](https://cssdoc.dev) rather than a modifier. Its own modifiers
(`.block__element--mod`) are captured as part of the element name for now.

***

### propValue?

```ts
propValue?: boolean;
```

Defined in: [packages/core/src/modifier.ts:64](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L64)

Split the modifier body into `prop`/`value` on [ModifierConvention.propValueSeparator](#propvalueseparator)?
Defaults to `false`. Ignored for `attribute` (which always derives `prop` from the attribute name
and `value` from the attribute value).

***

### propValueSeparator?

```ts
propValueSeparator?: string;
```

Defined in: [packages/core/src/modifier.ts:66](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L66)

The separator for the `prop`/`value` split. Defaults to `-`.

***

### pseudoElements?

```ts
pseudoElements?: string[];
```

Defined in: [packages/core/src/modifier.ts:58](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L58)

Native pseudo-elements (without the `::`) to document when they appear on a component's selectors,
e.g. `["before", "after"]`. Defaults to [DEFAULT_PSEUDO_ELEMENTS](../variables/DEFAULT_PSEUDO_ELEMENTS.md) — a curated set of standard
pseudo-elements, excluding vendor/experimental ones. Shadow `::part()` is handled separately.

***

### separator

```ts
separator: string | string[];
```

Defined in: [packages/core/src/modifier.ts:33](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L33)

The prefix/delimiter, interpreted per [ModifierConvention.structure](#structure). May be a single
string or several — any one of which marks a modifier. Separators are matched literally.

***

### statePrefixes?

```ts
statePrefixes?: string[];
```

Defined in: [packages/core/src/modifier.ts:46](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L46)

Class prefixes that mark a **state** rather than a modifier (e.g. `["is-", "has-"]`). A class
chained to the base whose name starts with one of these is recorded as a state, and is never
treated as a modifier. Opt-in; no preset sets it by default.

***

### statePseudoClasses?

```ts
statePseudoClasses?: string[];
```

Defined in: [packages/core/src/modifier.ts:52](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L52)

Native pseudo-classes (without the `:`) to recognize as states when they appear on the base,
e.g. `["disabled", "checked"]`. Defaults to [DEFAULT_STATE_PSEUDO_CLASSES](../variables/DEFAULT_STATE_PSEUDO_CLASSES.md) — a curated set
of form/UI states, deliberately excluding ubiquitous interaction pseudos (`:hover`, `:focus`).

***

### structure

```ts
structure: "chained" | "suffix" | "attribute";
```

Defined in: [packages/core/src/modifier.ts:28](https://github.com/thedannywahl/cssdoc/blob/main/packages/core/src/modifier.ts#L28)

The structural form. An open union — further forms may be added without a breaking change.
