> For the complete documentation index, see [llms.txt](https://design-packs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://design-packs.gitbook.io/docs/fundamentals/custom-css/mobile-css-examples.md).

# Mobile CSS examples

### How to control text size on mobile/ smaller devices

All of the font sizes in Design Packs are controlled by CSS variables, so you can update the size of text depending on the screen size. Copy and paste the following code into the Mobile CSS and change the values to see the font size adjust.  These pixel sizes will grow or shrink based on how large you have set the size with the "Text size" slider.

\--dp-heading-size will affect all of the larger h1, h2 headings (default size is 35px)\
\--dp-small-heading-size will affect the smaller headings such as h3, h4, h5, h6 (default size is 24px)\
\--dp-body-size will affect paragraphs, buttons, product titles, etc (default size is 18px)

```css
{
--dp-heading-size: 20px;
--dp-small-heading-size: 18px;
--dp-body-size: 13px;
}
```

If you would prefer to hardcode the font size (it will NOT change when the "Text size" setting changes, then use the following code and update the pixel values to your preferred numbers.

```css
.dsgn-pck__heading {
  font-size: 20px;  
}

.dsgn-pck__small-heading {
  font-size: 18px;
}

.dsgn-pck__text p {
  font-size: 18px;
}

.dsgn-pck__text a {
  font-size: 18px;
}

.dsgn-pck__button {
  font-size: 18px;
}

```

### How to hide section on mobile

To hide a section on mobile, add the following code only into the Mobile CSS field:

```css
{
  display: none;
}
```

### How to show a section ONLY on mobile

To hide a section on desktop and show on mobile, add the following code into the CSS field:

```css
{
  display: none;
}
```

And then add the following code into the Mobile CSS field:

```css
{
  display: block;
}
```


---

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

```
GET https://design-packs.gitbook.io/docs/fundamentals/custom-css/mobile-css-examples.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.
