### Bug description

Hello,

Thank you so much for this awesome piece of software!

I would like to report a potential bug.

When setting `collapse-below: sm` for `navbar`, the search button is dragged to the left before `sm` (and then when the width has reached `sm`, it goes back to the right).

My `_quarto.yml` is as follows:

```yml
project:
  type: website

website:
  title: "Some Website"
  navbar:
    title: false
    logo: logo.svg
    collapse-below: sm
    left:
      - href: index.qmd
        text: Home
      - about.qmd

format:
  html:
    theme: cosmo
    css: styles.css
    toc: true
```

In addition to the above issue, I would like to have a suggestion for improvement. I think the default threshold (`lg`) for collapsing is just too high. **In general, collapsing should only happen when there is not enough space left.** Therefore, it would be great if this can be implemented dynamically based on the available space, similar to Jekyll's Minimal Mistakes theme (this is a GIF image, so please click on the Play button to see animation):

![](https://mmistakes.github.io/minimal-mistakes/assets/images/mm-priority-plus-masthead.gif)


### Checklist

- [ ] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [ ] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [ ] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
dragonstyle
2023-04-17T13:41:14Z
netw0rkf10w
bug websites triaged-to
v1.4
open
Search button dragged to the left 
https://github.com/quarto-dev/quarto-cli/issues/5212