squidfunk / mkdocs-material

Documentation that simply works
https://squidfunk.github.io/mkdocs-material/
MIT License
18.49k stars 3.34k forks source link

Back-to-top button does not follow palette settings #7124

Closed zx80 closed 2 weeks ago

zx80 commented 2 weeks ago

Context

No response

Bug description

On

theme:
  features:
    - navigation.top
  palette:
    primary: orange

The back-to-top button seems to be highlighted with the default indigo color, whereas it would make sense to use the palette setting.

Related links

Reproduction

9.5.19-back-to-top-button-highlight-color.zip

Steps to reproduce

Open the minimal example, move down then up the page, go to the "back-to-top" button and look at its indigo color, whereas another color would make sense.

Browser

No response

Before submitting

squidfunk commented 2 weeks ago

Thanks for reporting. Material Design mandates the user of two complementing color tints, primary and accent. The back-to-top button uses the accent color for highlighting to denote that you can click it:

Bildschirm­foto 2024-04-29 um 15 07 20

If you do not like that, you can easily override the back-to-top button styling with some additional CSS ☺️ Or, if you want to change it to orange, just use:

theme:
  features:
    - navigation.top
  palette:
    primary: orange
    accent: orange

Closing as working as intended.

zx80 commented 2 weeks ago

Argh, sorry for the noise!

zx80 commented 2 weeks ago

After giving it some thought, think that it would make sense to keep primary and accent synchronized by default, i.e. the default accent value should be the same as primary unless explicitely told otherwise.

I do not see the value of having to switch two configuration directives to have a consistent choice of color, and this was my underlying expectation when I (wrongly) reported this as a bug: some color-clever people made informed choices, and I wanted to have the benefit with minimal effort: the colors of the same name are not actually the same colors for primary and accent, the former is a brighter version if I'm not mistaken.

squidfunk commented 2 weeks ago

Thanks for suggesting. Regardless of whether one would consider this sensical (I kindly disagree), whis would be a departure from the current behavior, which must considered to be a breaking change, as the output changes without the author doing anything. Since this change has zero upside, we cannot consider it.

I hope you understand this decision and just change the color to your liking 😅

zx80 commented 2 weeks ago

I hope you understand this decision and just change the color to your liking 😅

Obviously!