<!-- Generated by tools/SharpCell.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# ConditionalStyle

```csharp
public sealed class ConditionalStyle
```

Namespace `SharpCell` · package `SharpCell`

What a conditional format changes about a cell's look, as Excel's Format Cells for a rule sets it: the font's style and colour, the fill, the borders and the number format. A property left null keeps what the cell has. A record: `with` makes a changed copy.

## Constructors

<a id="ctor"></a>
### ConditionalStyle()

```csharp
public ConditionalStyle()
```

A look that changes nothing; set properties in an initializer.

## Properties

<a id="bold"></a>
### Bold

```csharp
public bool? Bold { get; init; }
```

Bold, or not bold; null keeps the cell's.

<a id="bottomborder"></a>
### BottomBorder

```csharp
public CellBorder? BottomBorder { get; init; }
```

The bottom border; null keeps the cell's.

<a id="fill"></a>
### Fill

```csharp
public CellColor? Fill { get; init; }
```

The fill colour; null keeps the cell's.

<a id="fontcolor"></a>
### FontColor

```csharp
public CellColor? FontColor { get; init; }
```

The text colour; null keeps the cell's.

<a id="greenfill"></a>
### GreenFill

```csharp
public static ConditionalStyle GreenFill { get; }
```

A green fill with dark green text.

<a id="italic"></a>
### Italic

```csharp
public bool? Italic { get; init; }
```

Italic, or not italic; null keeps the cell's.

<a id="leftborder"></a>
### LeftBorder

```csharp
public CellBorder? LeftBorder { get; init; }
```

The left border; null keeps the cell's.

<a id="lightredfill"></a>
### LightRedFill

```csharp
public static ConditionalStyle LightRedFill { get; }
```

A light red fill with dark red text, Excel's first preset.

<a id="numberformat"></a>
### NumberFormat

```csharp
public string? NumberFormat { get; init; }
```

The number format code, such as `0.00%`; null keeps the cell's.

<a id="rightborder"></a>
### RightBorder

```csharp
public CellBorder? RightBorder { get; init; }
```

The right border; null keeps the cell's.

<a id="strikethrough"></a>
### Strikethrough

```csharp
public bool? Strikethrough { get; init; }
```

Struck through, or not; null keeps the cell's.

<a id="topborder"></a>
### TopBorder

```csharp
public CellBorder? TopBorder { get; init; }
```

The top border; null keeps the cell's.

<a id="underline"></a>
### Underline

```csharp
public CellUnderline? Underline { get; init; }
```

The underline; null keeps the cell's.

<a id="yellowfill"></a>
### YellowFill

```csharp
public static ConditionalStyle YellowFill { get; }
```

A yellow fill with dark yellow text.

## Methods

<a id="applyto-cellstyle"></a>
### ApplyTo(CellStyle)

```csharp
public CellStyle ApplyTo(CellStyle style)
```

The style with what this one sets put over it.

**Parameters**

- `style`: The cell's own style.
