python / python-docs-theme

Sphinx theme for Python documentation
Other
74 stars 58 forks source link

Add backgrounds and borders to admonitions #190

Closed hugovk closed 1 month ago

hugovk commented 2 months ago

Only some of the "admonitions" have backgrounds and borders, giving them slightly different indentations:

image

We're missing backgrounds and borders for most of them:

Other themes have them for all:

Let's also fill in the gaps.

Before

image image

After

image image

Screenshots using this from the Kitchen Sink:

Details ```rst .. Copyright (c) 2021 Pradyun Gedam Licensed under Creative Commons Attribution-ShareAlike 4.0 International License SPDX-License-Identifier: CC-BY-SA-4.0 =========== Admonitions =========== Sphinx provides several different types of admonitions. ``topic`` ========= .. topic:: This is a topic. This is what admonitions are a special case of, according to the docutils documentation. We also support *italic*, **bold**, ``code``, `links `_, and more. ``admonition`` ============== .. admonition:: The one with the custom titles It's got a certain charm to it. We also support *italic*, **bold**, ``code``, `links `_, and more. ``attention`` ============= .. attention:: Climate change is real. We also support *italic*, **bold**, ``code``, `links `_, and more. ``caution`` =========== .. caution:: Cliff ahead: Don't drive off it. We also support *italic*, **bold**, ``code``, `links `_, and more. ``danger`` ========== .. danger:: Mad scientist at work! We also support *italic*, **bold**, ``code``, `links `_, and more. ``error`` ========= .. error:: Does not compute. We also support *italic*, **bold**, ``code``, `links `_, and more. ``hint`` ======== .. hint:: Insulators insulate, until they are subject to ______ voltage. We also support *italic*, **bold**, ``code``, `links `_, and more. ``important`` ============= .. important:: Tech is not neutral, nor is it apolitical. We also support *italic*, **bold**, ``code``, `links `_, and more. ``note`` ======== .. note:: This is a note. We also support *italic*, **bold**, ``code``, `links `_, and more. ``seealso`` =========== .. seealso:: Other relevant information. We also support *italic*, **bold**, ``code``, `links `_, and more. ``tip`` ======= .. tip:: 25% if the service is good. We also support *italic*, **bold**, ``code``, `links `_, and more. ``warning`` =========== .. warning:: Reader discretion is strongly advised. We also support *italic*, **bold**, ``code``, `links `_, and more. ```
hugovk commented 1 month ago

Thanks all for the reviews, let's merge and release. We can adjust and iterate the others in the future.