Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

HTML5.2 proposal (request for comments): add new attribute "subject" to <p> #846

Closed
spixi opened this issue Mar 29, 2017 · 2 comments
Closed

Comments

@spixi
Copy link

spixi commented Mar 29, 2017

It should be possible to assign an optional subject to a paragraph which is displayed as a "catchword" before the paragraph, usually inline, in some books also next to the paragraph on the page margin. Unlike headings (h1 to h6) the subject is only valid for a single paragraph.

The DIN 5008 mentions this catchword as "Teilbetreff", it is used for business letters in Germany and may also occur in essays and reports to enable readers to quickly capture the context and help to retrieve paragraphs they are looking for.

Another common use is the place of reporting at the beginning of newsletter articles.

The new attribute subject should not be confused with the global attribute title. Unlike the latter, subject should be displayed by default. It may also not be mixed up with the <DT> tag which is used for items of a description list.

Specification

The subject attribute contains a "catchword" (which, of course, may consist of multiple words) which is shown the content of a paragraph. The new CSS pseudoclass p::subject should be used to alter how the subject is shown. It defaults to:

p::subject {
    font-size: 100%; /* inherit from the <p> */
    display: inline;
    font-weight: bold
}
p::subject::after {
    content: '.'
}

subject SHOULD be used for

  • providing a "catchword" to a paragraph
  • place of reporting in a newsletter article

subject MUST NOT be used for

  • longer descriptions about a paragraph, e. g. a summary or any background information
  • versals (ornamental letters that begin a section)

What do you think about this proposal?

@chaals
Copy link
Collaborator

chaals commented Mar 30, 2017

This can be done easily with CSS and a data-* attribute today, something like

style:

p[data-teilbetreff]::before {content: attr(data-subject);margin-left:-2em}

and in the document:

<p data-teilbetreff="happiness">Tequila is a Mexican spirit. The Reposada variety was developed in anticipation of the Web Platform co-chair.</p>

To justify making browsers handle this natively it is important to demonstrate that there is a common enough demand for it across the Web - and that this is the right approach.

Another possible solution, if the use case is demonstrated as important enough to convince browsers to deal with the issue, would be to allow the summary element as a child of p, although this may have other problems...

Anyway, I think before we take this on, it should be incubated to get buy-in. You might want to move it to WICG, or wherever you find convenient, and bring it back if it gets substantial support.

For now I will close it here, but it can be re-opened if there's support…

ping @TzviyaSiegman

@chaals chaals closed this as completed Mar 30, 2017
@TzviyaSiegman
Copy link

Thanks. This is conceptually related to work done in IDPF's EPUB for Education. It's similar to epub:type="keyword". DPUB has plans to shift the epub:type vocab [1] into something that is html- friendly. cc/@rickj

[1] https://idpf.github.io/epub-vocabs/structure/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants