facebook / facebook/docusaurus

Theme switch button position should be configurable

Aperta
#10,881 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature
Lingua principale
TypeScript
Stelle
66.2k
Fork
10k
Merge medio
1g 3h
PR unite (30g)
52

Descrizione

### Have you read the Contributing Guidelines on issues?

- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Description

Currently in the config file you can only either enable or disable the theme switch button through themeConfig->colorMode. But if there was an option of a navbar-item called themeSwitchButton and you could modify its position it would be good.

Example:
```
themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: '',
logo: {
alt: 'Docusaurus Logo',
src: 'img/logo.svg',
srcDark: 'img/logo-dark.svg',
},
items: [
{
type: 'themeSwitchButton',
position: 'right',
},
],
},
```

### Has this been requested on Canny?

_No response_

### Motivation

For example if you do not mention searchbar's position it is on the right of the theme switch button. But if you specifically say right, it moves to the left of the theme switch button. This is very unintuitive in my opinion. I believe the first item on the list that says right is on the leftmost side of the items on the right. With this simple feature we have more config options for the themeSwitchButton.

### API design

_No response_

### Have you tried building it?

_No response_

### Self-service

- [ ] I'd be willing to contribute this feature to Docusaurus myself.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.