> For the complete documentation index, see [llms.txt](https://docs.keycloakify.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keycloakify.dev/keycloakify/v10/customization-strategies/css-level-customization/removing-the-default-styles.md).

# Removing the default styles

## Case by case

You may notice that beside the the kcSomething classes other classes are applied to the components.

<figure><img src="/files/ncs7hF1BMA1mDyODm3eK" alt=""><figcaption><p>The &#x3C;header> element has an extra class beside kcFormHeaderClass: login-pf-header</p></figcaption></figure>

This other classes, non prefixed with kc actually have styles rules that target them. Let's as an example remove the login-pf-header class:

<pre class="language-tsx" data-title="src/login/KcPage.tsx"><code class="lang-tsx">import "./main.css";
// ...

export default function KcPage(props: { kcContext: KcContext }) {
  // ...
}

const classes = {
<strong>    kcFormHeaderClass: ""
</strong>} satisfies { [key in ClassKey]?: string };
</code></pre>

<figure><img src="/files/1vxLph1jQO45UEZbkRz8" alt=""><figcaption><p>We can see that now, the &#x3C;header> element only have the kcFormHeaderClass, the login-pf-header class has been removed. As a result the text is now aligned to the left (default layout)</p></figcaption></figure>

On some components, multiples utility classes are applied, you may want to keep some of them and remove others. Example:

<figure><img src="/files/cJiDki01tzgg48ksHIEt" alt=""><figcaption><p>Here we can see that a bunch of col-* classes gets applied to the element with kcInputWrapperClass</p></figcaption></figure>

Let's say, for example, that we would like to remove keep only the col-md and lg classes. To do that that we would write:

{% code title="src/login/KcPage.tsx" %}

```tsx
import "./main.css";
// ...

export default function KcPage(props: { kcContext: KcContext }) {
  // ...
}

const classes = {
  kcInputWrapperClass: "col-md-12 col-lg-12",
} satisfies { [key in ClassKey]?: string };
```

{% endcode %}

Result:

<figure><img src="/files/ENnF7ifoETd6PcJO3fP1" alt="" width="375"><figcaption></figcaption></figure>

## Removing all the default styles at once

Maybe you'd prefer to remove all default styles at once you can do that by setting doUseDefaultCss to false.

<pre class="language-tsx" data-title="src/login/KcPages.tsx"><code class="lang-tsx">export default function KcPage(props: { kcContext: KcContext }) {

    return (
        &#x3C;Suspense>
            {(() => {
                switch (kcContext.pageId) {
                    default:
                        return (
                            &#x3C;DefaultPage
                                kcContext={kcContext}
                                i18n={i18n}
                                classes={classes}
                                Template={Template}
<strong>                                doUseDefaultCss={false}
</strong>                                UserProfileFormFields={UserProfileFormFields}
                                doMakeUserConfirmPassword={doMakeUserConfirmPassword}
                            />
                        );
                }
            })()}
        &#x3C;/Suspense>
    );
}
</code></pre>

However be aware that re-styling everything involves quite a bit of work:

<figure><img src="/files/NLw8S2vAf0B7xstpmszr" alt="" width="375"><figcaption><p>The login page with doUseDefaultCss set to false</p></figcaption></figure>

Up next:

{% content-ref url="/pages/ngO4Ccs4QpvgwCBAqzxW" %}
[Applying your own classes](/keycloakify/v10/customization-strategies/css-level-customization/applying-your-own-classes.md)
{% endcontent-ref %}


---

# 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.keycloakify.dev/keycloakify/v10/customization-strategies/css-level-customization/removing-the-default-styles.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.
