Skip to content

RFC: change Docusaurus admonition warning color from red to yellow #7558

Closed

Description

@slorber

Have you read the Contributing Guidelines on issues?

Motivation

This is what Docusaurus displays if you use :::warning

CleanShot 2022-06-03 at 17 08 35@2x

I believe it should be:

CleanShot 2022-06-03 at 17 11 01@2x


Note: Infima already uses alert--warning class for this yellow color.

Maybe this is a historical typo?

Most likely coming from our remark-admonition dependency:

https://github.com/elviswolcott/remark-admonitions/blob/master/lib/index.js#L31

  warning: {
    ifmClass: "danger",
    keyword: "warning",
    emoji: "🔥", //'🔥'
  },
  caution: {
    ifmClass: "warning",
    keyword: "caution",
    emoji: "⚠️", // '⚠️'
  }

All other doc tools use yellow for warnings:

v1.vuepress.vuejs.org/guide/markdown.html#custom-containers

nextra.vercel.app/themes/docs/callout

vitepress.vuejs.org/guide/markdown.html#custom-containers

docs.gitbook.com/editing-content/rich-content/with-command-palette#hints-and-callouts


The migration strategy remains to be defined: how do we avoid user site admonitions to move from red to yellow without them being aware of this change?

Important note: we don't even document :::warning, it is a historical alias/shortcut for :::caution which is how to use the yellow admonition color today.

Are there a lot of third-party sites using :::warning today?

:::caution is less natural to me: should we deprecate it in favor of a new first-class (not an alias) :::warning admonition key?

(although in practice there's not a clear difference of an alias vs a first class admonition key)

Related to #7556

Self-service

  • I'd be willing to do some initial work on this proposal myself.

Activity

  1. added
    proposal
    status: needs triage
    on Jun 3, 2022
  2. added
    better engineering
    and removed
    proposal
    status: needs triage
    on Jun 3, 2022
  3. added this to the 3.0 milestone on Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    better engineering

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions