Skip to content

autosummary tables could use an extension-specific CSS class #10234

@2bndy5

Description

@2bndy5

Is your feature request related to a problem? Please describe.

We are working on a theme that does not inherit from a builtin theme's CSS. When using autosummary with this theme, the tables inherit a CSS rule not designed for autosummary tables. We'd like a way to identify (via CSS) an autosummary table from other parts of the document(s).

Describe the solution you'd like

In discussing how to override our theme's rule using a way to only target autosummary tables, we've agreed that autosummary should use an extension-specific CSS class that would distinguish its tables.

Describe alternatives you've considered

  1. Use a special CSS override whose selectors target only autosummary tables. This approach carries some uncertainty because of the problem stated above. In the meantime, we've gone with this approach since the longtable CSS class seems to be intended for latex writers.
  2. Monkey patch the autosummary_table_visit_html() in our theme's source. This seems unnecessarily complex to target only autosummary tables. It also may not be forward compatible.

Additional context

The theme's css rule that causes problems is

.md-typeset code {word-break: break-word;}

We needed to design a rule that sets word-break: normal; as it was presumptuously intended by autosummary.

Our theme's issue was reported in jbms/sphinx-immaterial#35

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions