Skip to content

Simplify how code color is defined #1387

@chalin

Description

@chalin

Here's how <code> element color is defined in Docsy currently:

  1. assets/scss/_variables.scss overrides the Bootstrap $code-color variable. The BS $code-color default is pink (unlikely to be a useful color), but Docy's override of using the secondary color as a base isn't much more helpful (at least not in projects I've worked on).
  2. Docsy has context-specific overrides setting code color to inherit, which usually means it'll fall back to $body-color (a reasonable default IMHO):
  • .td-content p code
  • .td-content li > code
  • .td-content table code
  1. But some contexts fall back to $code-color, such as the <dd> in Shortcode blocks.

On almost all projects that I've worked on, a single code color is used throughout the project, and often it matches the base "body color". So, IMHO, we should set $code-color to be equivalent to $body-color1 and use this in all contexts (i.e., avoid contextual overrides).

Thoughts?

Note that this issue is a followup to:

Footnotes

  1. We'll probably need to set it to var(--bs-body-color) since BS's $body-color won't be defined by the time we choose to set the value of $code-color.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions