rust-lang / rust-lang/mdBook

Create a custom.css for small theme CSS additions

Open Beginner friendly
#3,166 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

Today I came across a bug when upgrading from mdbook 0.5.3 to 0.5.4 - that I had an image that was included doubly all of a sudden.

This had to do with the new zoomable image feature, which required new parts in general.css

I've added some small classes for some headings in my general.css, and so I had a custom file. Merging the two is an additional step that requires a bit of finesse.

Proposed Solution

I suggest an empty custom.css file be included in the standard theme, maybe with a comment explaining that this is for small enhancements.

Including an edited version of this file in theme/css would allow my custom heading styles and so on to live on without needing to merge the general.css file every time there is an update to mdbook.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the standard theme files under theme/css, especially general.css, and how those assets are included in the theme. Add the empty custom.css requested in the issue and verify that it is included in the standard theme alongside the existing CSS files.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation, frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.