import {Meta} from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/scripts/Classes/StylesToVirtual - Pseudo-Element Generator'/>

# StylesToVirtual Class

The `StylesToVirtual` class is responsible for generating CSS pseudo-elements (like `::before`, `::after`) and their associated styles.

## Key Features

- **Pseudo-Element Wrapping** — Automatically wraps content within a `&::[name]` selector.
- **Automatic Content Property** — For pseudo-elements like `before` and `after`, it automatically injects `content: ' ';` if not otherwise specified.
- **Indentation Management** — Correctly handles block indentation and optional leading empty lines.

## Initialization

Initialize the `StylesToVirtual` converter with the required property and content callable.

**Parameters:**
- `property: PropertyItemsItem` — the current branch of the property tree being processed.
- `space: string` — the indentation string.
- `content?: () => string[]` — a callable function that returns an array of strings representing the style rules for the pseudo-element.
- `first?: boolean` — indicates if this is the first element (optional).

```typescript
import { StylesToVirtual } from '@dxtmisha/scripts'

const converter = new StylesToVirtual(property, '  ', contentCallable)
const result = converter.make()
```

## Methods

### Control

- `make(): string[]` — The main entry point. Orchestrates the process of wrapping nested styles in a pseudo-element block.
