# Theme UI

> [Theme UI](https://theme-ui.com/getting-started) combines several libraries together to form a mini-framework for styling applications.

> Theme UI is built with:
>
> * [Emotion](https://emotion.sh/docs/introduction): used to generate isolated CSS with theming context
> * [MDX](https://mdxjs.com/): used to provide custom Emotion styled components to MDX documents, without polluting the global CSS scope
> * [Typography.js](https://github.com/KyleAMathews/typography.js): optionally used for creating rich typographic styles with a simple, high-level API

Theme UI includes an optional presets package that can be used as examples or as a starting point for extending your own themes.

```
npm i theme-ui @theme-ui/presets
```

Make a file `theme.js`  on the root of your app. To view an example of the built-in presets, see the [Demo](https://theme-ui.com/demo).

`theme.js` uses a preset theme "*bulma*" with some extras:

```jsx
import { bulma } from '@theme-ui/presets'

const theme = {
  ...bulma,
  containers: {
    card: {
      boxShadow: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
      border: '1px solid',
      borderColor: 'muted',
      borderRadius: '4px',
      p: 2,
    },
    page: {
      width: '100%',
      maxWidth: '960px',
      m: 0,
      mx: 'auto',
    }
  },
  styles: {
    ...bulma.styles
  }
}

export default theme
```

```jsx
import React from 'react'
import {ThemeProvider} from 'theme-ui'
import theme from '../theme'

function App({ Component, pageProps }) {
  return(
    <ThemeProvider theme={theme}> 
    <Component {...pageProps} />
    </ThemeProvider>
  )
}

export default App
```


---

# Agent Instructions: 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:

```
GET https://olga-f.gitbook.io/react/design-systems/theme-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
