> For the complete documentation index, see [llms.txt](https://help.pickzen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pickzen.com/design-system/howto/use-css-in-custom-component.md).

# Use CSS in custom component

When you create a custom component, you can define the CSS of your component in a CSS file or inline. If you use an external file double-check you use prefixed classes, otherwise, it can create conflicts if the component is rendered in the hosting page without an iFrame.

If your component defines properties that need to be used in the CSS file, you can use CSS variables. For example, say your component defines a color property. It can be set this way:

```
<div className={`my-component ${props.classes}`} 
     style={ {...style, '--color':props.color} }>
</div>
```

In the CSS file it can be referenced this way:

```
.my-component {
  background-color: var(--color)
}
```


---

# 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://help.pickzen.com/design-system/howto/use-css-in-custom-component.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.
