> For the complete documentation index, see [llms.txt](https://docs.coreframework.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coreframework.com/navigating-the-ui/utility-classes-and-vars.md).

# Utility Classes & Vars

Core Framework allows you to create utility classes and variables in all cases. Variables are automatically generated in cases where you might reuse them, such as colors, text size and spacing!

With the flexibility of Core Framework, we offer options where you can create utility classes from variables.&#x20;

In this example, the Spacing section allows you to generate 3 different sets of utility classes ranging from gap, margin, and padding:

<figure><img src="https://949277485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp10Tm4nYjo9MojbZ6zQt%2Fuploads%2FRfU6TWedcij2LBsXSUTK%2Fimage.png?alt=media&amp;token=f873d49e-f262-4610-91dc-f5f2ed526026" alt=""><figcaption><p>Options to create utility classes</p></figcaption></figure>

This will automatically create utility classes using all of the variables created from the section above it. In the CSS, you will see that many new classes have been generated.&#x20;

For example, `.gap-m` will now have a value of `var(--space-m)` applied to it. Very powerful stuff! 🔥

## Creating new Groups

### Create a selector group

Creating a new group is very simple. At the bottom of the section you're in, simply click on the "Create a selector group" button. Enter a name for your group and then start adding your selectors along with the properties and values!

{% hint style="info" %}
You may notice that adding values will bring up a list of your existing variables! 🔥
{% endhint %}

<figure><img src="https://949277485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp10Tm4nYjo9MojbZ6zQt%2Fuploads%2F6Bw8Tcuv2hSWpIyEt0Aa%2Fimage.png?alt=media&amp;token=6a5b20f5-b387-406f-93bb-55fb3e02c1cc" alt=""><figcaption><p>Adding new selectors</p></figcaption></figure>

### Create a variable group

To create a new variable group, simply click on the "Create a variable group" button at the bottom right. Then, give the group a name and start adding your variables. You'll notice that your variables will always be prefixed with --.

<figure><img src="https://949277485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp10Tm4nYjo9MojbZ6zQt%2Fuploads%2FY8DMSeM5yR4F2Ga7N8TF%2Fimage.png?alt=media&amp;token=f3530b04-1771-4def-aa36-8d3dd707f92a" alt=""><figcaption></figcaption></figure>


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coreframework.com/navigating-the-ui/utility-classes-and-vars.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
