# New default nav style and simplified color scheme

**URL:** https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597
**Category:** Announcements
**Created:** [June 24, 2024, 1:45pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597 "2024-06-24T13:45:47Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [June 24, 2024, 1:45pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/1 "2024-06-24T13:45:47Z")

</div>

# What’s changing

Soon our “top menu” and similarly styled navigation (sometimes referred to as nav pills) will have an updated and more consistent style throughout Discourse.

**Top Menu**

Before:  
 ![image](https://global.discourse-cdn.com/meta/optimized/4X/1/1/d/11df31266fb80dc0afb0f274980590fd5b884bd0_2_690x37.png)

After:  
 ![image](https://global.discourse-cdn.com/meta/optimized/4X/f/e/8/fe86ca0a9895592c4065eb4016e02382e2e93628_2_690x41.png)

**Profile Menu**

Before:

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/2/1/e2168037c14c3822dc835f56fdc79db3bc18a949.png)

After:

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/e/5/8e51bbb3ecdd0f2a0986c9c1a847fc5707f516f6.png)

# Why is it changing?

This allows us to simplify our default CSS and remove the use of the “quaternary” color in the default Discourse theme. This color has been used by many themes over the years, so it will still be available for use in custom CSS.

The use of this color, which is very similar to “danger red” by default, made it difficult to do things like highlight an active filter… because in this state it looks like an error:

Before:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/f/5/3/f53aa075fe344b98ac07cf04c12506a0851ad566.png)

After:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/8/2/a/82aa9a92e8e91d2fc532e33d89c3d2eb27d0990b.png)

# How do I change this in themes?

Along with this update, we’ve also made it easier to change these nav colors in themes using CSS custom properties. We have some new variables:

```css
:root {
  --d-nav-color: var(--primary);
  --d-nav-bg-color: transparent;
  --d-nav-color--hover: var(--primary);
  --d-nav-bg-color--hover: var(--d-hover);
  --d-nav-color--active: var(--tertiary);
  --d-nav-bg-color--active: transparent;
  --d-nav-border-color--active: var(--d-nav-color--active);
  --d-nav-underline-height: 0.125em;
}

```

So rather than adding multiple sets of custom CSS to change each nav instance, you can change variables as needed. For example:

```css
:root {
  --d-nav-color--active: mediumorchid;
}

```

Applying this CSS would result in:

![image](https://global.discourse-cdn.com/meta/original/4X/9/9/6/996645c779c331804fcd0448d558fce78e756307.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/f/4/7f45cc5b8c24f5ce7776eb47b159d78e9df0a6b4.png)

## Where is this underline coming from?

You may notice that the “underline” of the active nav item doesn’t make use of the `border-bottom` CSS property. Instead it’s applied using an `::after` [pseudo element](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements#what_is_a_pseudo-element).

Existing themes may already make use of the `border` property, so this method will hopefully make it easier to remove our underline if it clashes with existing styles. To remove:

```css
:root {
  --d-nav-underline-height: 0;
}

```

![image](https://global.discourse-cdn.com/meta/original/4X/a/7/0/a708c8caa1af5b7cb77d2c2edc256a341de6b71e.png)

## What if I preferred the old style?

Using the new CSS variables makes this fairly easy to get back to. In your theme you can apply:

```css
:root {
  --d-nav-color--hover: var(--quaternary);
  --d-nav-bg-color--hover: var(--quaternary-low);
  --d-nav-color--active: var(--secondary);
  --d-nav-bg-color--active: var(--quaternary);
  --d-nav-border-color--active: var(--primary-medium);
  --d-nav-underline-height: 0;
}

```

![image](https://global.discourse-cdn.com/meta/original/4X/2/1/a/21aa74929589964f44015752f4b903af7a329085.png)

If you only want to change one instance of this nav, you can scope the variable changes to an ID or class, for example `#navigation-bar` instead of `:root`:

```css
#navigation-bar {
  --d-nav-color--hover: var(--quaternary);
  --d-nav-bg-color--hover: var(--quaternary-low);
  --d-nav-color--active: var(--secondary);
  --d-nav-bg-color--active: var(--quaternary);
  --d-nav-underline-height: 0;
}

```

![image](https://global.discourse-cdn.com/meta/original/4X/e/4/0/e404a2f146cb5bd75689e44b171c8f9220cfe50e.png)

another example:

```css
.user-navigation {
  --d-nav-bg-color--active: lightcyan;
}

```

![image](https://global.discourse-cdn.com/meta/optimized/4X/2/e/5/2e50b658bd3e6751db3098df53b921ea9606b277_2_690x68.png)

Not sure how to change CSS? check out [Making custom CSS changes on your site](https://meta.discourse.org/t/make-css-changes-on-your-site/168101)

That’s all for now! As always, let us know if you have any questions or encounter any issues along the way. 🚀

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [June 24, 2024, 4:20pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/2 "2024-06-24T16:20:59Z")

</div>

I like it! It’s modern, less visually intrusive, and on top of that, it simplifies the CSS. Good job! :chefs_kiss:

---

<div class="post-metadata">

### Author: ![nobrowser](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nobrowser/32/240031_2.png) [@nobrowser](https://meta.discourse.org/u/nobrowser)
#### Post date: [June 25, 2024, 12:16am UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/3 "2024-06-25T00:16:19Z")

</div>

In your examples, color is not the only difference between “old” and “new”. Font size looks smaller in the “new” examples. Is that intended or accidental?

I feel there has been way too much churn with the default font size already ☹

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [June 25, 2024, 12:44am UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/4 "2024-06-25T00:44:31Z")

</div>

It doesn’t look different in size to me, could you maybe say which image it looks different?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [June 25, 2024, 11:40am UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/5 "2024-06-25T11:40:13Z")

</div>

I think it’s this (taken on [ask.replit.com](http://ask.replit.com)):

 ![Screenshot_20240625_193539_One UI Home](https://global.discourse-cdn.com/meta/original/4X/4/c/d/4cdc7cb1490f6fed6354c85ec214d997eea0c699.jpeg)  
It seems that the text is smaller.

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [June 25, 2024, 12:41pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/6 "2024-06-25T12:41:36Z")

</div>

> [@nobrowser](#):
>
> Font size looks smaller

> [@NateDhaliwal](#):
>
> It seems that the text is smaller.

Looks like the font size changed [on this line here](https://github.com/discourse/discourse/pull/27502/files#diff-6cbba300b6ff5d7d73249c717a53da2e58c6d7be9d973e214d2799caa3448d33L37) when `--font-up-1` font-size was removed and so now it defaults to the `--base-font-size`. And in the case of the mobile dropdown nav, `--font-down-1` is still applied but without the `--font-up-1`.

previous style:

```plaintext
.nav-pills {
  > li {
    > a,
    button {
      font-size: var(--font-up-1);

```

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [June 25, 2024, 1:02pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/7 "2024-06-25T13:02:39Z")

</div>

I noticed that too. The font of the category and tag dropdowns is larger than “Latest” next to it. And “Latest” is even smaller than the excerpt of the pinned topic when you don’t hide the sidebar.

 ![Screenshot_20240625_152331_Chrome](https://global.discourse-cdn.com/meta/original/4X/d/b/5/db5e91695d50920a233bbf2c5e4af53b75816d58.jpeg)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [June 25, 2024, 2:24pm UTC](https://meta.discourse.org/t/new-default-nav-style-and-simplified-color-scheme/312597/8 "2024-06-25T14:24:48Z")

</div>

Yes, the font-size adjustment was intentional (there were some slight spacing adjustments too). When we increased the overall font-size the filters became larger along with everything else — but now the dropdowns, filters, and new topic button text are all the same size.

If you’d like the text to be larger again, you can add some CSS…

Everything in the nav (dropdowns, filters, buttons):

```css
.navigation-container {
 font-size: var(--font-up-1);
}

```

Filters only:

```css
#navigation-bar {
 font-size: var(--font-up-1);
}

```

> [@nobrowser](#):
>
> I feel there has been way too much churn with the default font size already ☹

If you have any specific issues or suggestions, let us know and we can help!
