Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typography-base: process 'type' attribute of HTML <ol> tag #1357

Merged
merged 5 commits into from
Apr 27, 2021

Conversation

hpalacio
Copy link
Contributor

@hpalacio hpalacio commented Apr 23, 2021

Some markup languages like AsciiDoc, allow defining the 'type'
attribute of HTML <ol> tag.
For instance, the following AsciiDoc code:

[loweralpha]
. item1
. item2

Produces in GitHub the HTML code:

<ol type="a">
	<li>item1</li>
	<li>item2</li>
</ol>

The current SCSS doesn't cover this 'type' attribute, so the regular
default symbol (decimal) applies, instead of the one intended by the
author.

Signed-off-by: Hector Palacios [email protected]

Some markup languages like AsciiDoc, allow defining the 'type'
attribute of HTML <ol> tag.
For instance, the following AsciiDoc code:

	[loweralpha]
	. item1
	. item2

Produces in GitHub the HTML code:

	<ol type="a">
		<li>item1</li>
		<li>item2</li>
	</ol>

The current SCSS doesn't cover this 'type' attribute, so the regular
default symbol (decimal) applies, instead of the one intended by the
author.

Signed-off-by: Hector Palacios <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Apr 23, 2021

🦋 Changeset detected

Latest commit: 42ebe55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jonrohan
Copy link
Member

Interesting! I didn't realize it could do that, could you provide an example to a rendered link? I might want to namespace this so we're not directly effecting all ol

@hpalacio
Copy link
Contributor Author

hpalacio commented Apr 26, 2021

Hi @jonrohan
See example at https://github.com/hpalacio/markdown-test/blob/hpalacio/lists/lists.adoc.
The first part has no specifiers. Renders by default to:

  • level 1: decimal
  • level 2: lowerroman
  • level 3: loweralpha
  • level 4: loweralpha

The second part has some specifiers: loweralpha for level 2, lowerroman for level 3, decimal for level 4.

You can inspect the code to see how such lists render.

  • loweralpha: <ol type='a'>
  • lowerroman: <ol type='i'>

I was expecting "decimal" or "arabic" to also render as <ol type='1'> but that's not happening. I wonder if it's an issue of AsciiDoc.

In any case, without a specific style for the type attribute, the default style applies, so both lists render the same.
Check out how the list would show with the applied styles in https://codepen.io/hpalacio/pen/WNRLLwX

@jonrohan
Copy link
Member

Thanks so much @hpalacio! Going to include it in the next release

@jonrohan jonrohan merged commit 2477ee4 into primer:main Apr 27, 2021
@primer-css primer-css mentioned this pull request Apr 27, 2021
hpalacio referenced this pull request in asciidoctor/asciidoctor May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants