Skip to content

Consistent and semantic CSS for signatures #4390

Closed

Description

@timhoffm

Subject: Consistent and semantic CSS for signatures

I propse to introduce a consistent set of semantic CSS classes for easier styling of the signature.

Current state

Example signature:

Axes. vlines ( x, y, linestyles='solid' )

The corresponding HTML looks like this:

<dt id="matplotlib.axes.Axes.vlines">
<code class="descclassname">Axes.</code>
<code class="descname">vlines</code>
<span class="sig-paren">(</span>
<em>x</em>, <em>y</em>, <em>linestyles='solid'</em>
<span class="sig-paren">)</span>

Proposed change

Use this set of semantic CSS classes:

  • sig
    • sig-prename
    • sig-name
    • sig-paren
    • sig-param

These could simply be added to maintain compatibility with existing CSS files:

<dt id="matplotlib.axes.Axes.vlines" class="sig">
<code class="sig-prename descclassname">Axes.</code>
<code class="sig-name descname">vlines</code>
<span class="sig-paren">(</span>
<em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">linestyles='solid'</em>
<span class="sig-paren">)</span>

In the long run descclassname and descname could be deprecated. Also one could debate if one should change the tags <code> and <em> to <span>, but I have no strong opinion on this.

This scheme can be extend when more complex signatures arise, as proposed in #4289. For example one could add classes sig-paramname and sig-paramvalue.

Activity

  1. added this to the 2.0.0 milestone on Aug 26, 2018
  2. modified the milestones: 2.0.0, 2.1.0 on Feb 15, 2019
  3. added a commit that references this issue on May 27, 2019
    ae1e78a
  4. added 2 commits that reference this issue on May 28, 2019
    bd4cd57
    eea9fbb
  5. tk0miya commented on May 29, 2019

    @tk0miya
    Member

    Fixed by #4390.
    Thanks,

  6. locked as resolved and limited conversation to collaborators on Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    builder:htmltype:proposal

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions