> For the complete documentation index, see [llms.txt](https://docs.optis.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.optis.me/swatch/global-settings/custom-css.md).

# Custom CSS

For advanced styling beyond the built-in options, you can add your own CSS in **Global settings → Custom CSS**. The CSS is loaded on your storefront and applies to the OPTIS Color Swatch elements.

<figure><img src="/files/K6OYYFlqV4YxNsZdiQBI" alt="The Custom CSS editor in Global settings"><figcaption></figcaption></figure>

{% hint style="warning" %}
Custom CSS is an advanced feature. Incorrect rules can affect how swatches look. Test on a draft theme first if you are unsure, and keep a copy of your CSS so you can revert.
{% endhint %}

## How to add custom CSS

{% stepper %}
{% step %}

### Open Global settings

Go to **Global settings** and find the **Custom CSS** section.
{% endstep %}

{% step %}

### Write your CSS

Enter your CSS rules in the editor.
{% endstep %}

{% step %}

### Save

Click **Save**. Refresh your storefront to see the result.
{% endstep %}
{% endstepper %}

## Targeting OPTIS elements

The app renders its variant picker inside a custom element. You can target it in your CSS, for example:

```css
/* The OPTIS variant picker wrapper */
optis-variant-picker {
  margin-top: 12px;
}
```

{% hint style="info" %}
Most appearance changes (size, spacing, colors, borders, alignment) can be made without code on the [Styling](/swatch/styling/styling-overview.md) page. Use Custom CSS only for adjustments the Styling page does not cover.
{% endhint %}

If you are not sure how to target a specific element, reach out via live chat and our support team can help.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.optis.me/swatch/global-settings/custom-css.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
