w3c / w3c/mathml-core

Idea: Consider introducing CSS math-leading-space / math-trailing-space properties

Open
#218 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
56
Forks
20
PR merge metrics
No merged PRs in 30d

Description

We had mentioned some issues related to making operator properties compatible with CSS in the past (dependency on text content, properly handle embellished op, relative values, invalid values, etc). With the good effort made in level 1, I believe we could just map lspace/rspace attributes to new CSS properties math-leading-space / math-trailing-space and use these properties if non-auto (instead of the attribute). Actually that's how it's implemented internally in Chromium.

Operator spacing is only style, so we should be able to to that via CSS. That would basically allow authors to easily redefine their own spacing via e.g. CSS classes (again: but not from mo content) instead of asking to change the internal operator dictionary or to put explicit lspace/rspace everywhere:

.operator-with-thickmathspace {
  math-leading-space: 0.277777778em;
  math-trailing-space: 0.277777778em;
}

.latexml-invisible-op {
  math-leading-space: 0;
  math-trailing-space: 0;
}

<mo class="operator-with-thickmathspace">
<mo class="latexml-invisible-op">

I believe this would be more in line with the principle of the Web: having a stable, interoperable and well-tested operator dictionary but CSS properties to allow authors to easily customize it and maintain that style.

Note: this is different from margin/padding because of embellish op, handling in mrow only, interpretation of auto as "fallback to the dictionary", etc.

Possible extensions:

  1. Extend this to other mo attributes & operator properties.
  2. Extend this to other elements, so that people can more easily tweak interop spacing. Including implement negative spacing without "negative size' (#132).

Contributor guide

No contributing guide indexed for this repository

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 with the linked MathML Core algorithm for determining embellished-operator properties and review the existing discussion of lspace/rspace and operator properties. The work is done when the project has reached agreement on the proposed CSS properties, their interaction with auto and the operator dictionary, and any required specification updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.