Skip to content

Custom admonition icons don't work when defining theme.palette #3987

@locomoco28

Description

@locomoco28

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When trying to specify a custom icon for admonitions, the icons are not replaced when the mkdocs.yml also has theme.palette defined.

Expected behaviour

After commenting out the theme.palette key, we can see the expected behavior

image

Actual behaviour

The icon does not get replaced when specifying the theme.palette key

image

Steps to reproduce

Deploy the following example page using the mkdocs.yml specified below

<!-- docs/index.md -->
!!! note
    This is an example note

Package versions

  • Python: 3.8.13
  • MkDocs: 1.3.0
  • Material: 8.3.1

Configuration

# mkdocs.yml
site_name: "Example mkdocs material"

theme:
  name: material
  palette: # <- this is the culprit, commenting it out fixes the issue, but we use need it for dark/bright mode configuration
    scheme: default
  icon:
    admonition:
      note: octicons/alert-24
    logo: material/cloud

markdown_extensions:
  - admonition
  - pymdownx.details
  - pymdownx.superfences

System information

Locally using Win 10 and also in a newly created Gitpod.io workspace (cloud VS Code IDE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions