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

CSS Styles "Normal" Outputs as Classless Class Selector #4176

Open
tajmone opened this issue Dec 19, 2017 · 0 comments
Open

CSS Styles "Normal" Outputs as Classless Class Selector #4176

tajmone opened this issue Dec 19, 2017 · 0 comments

Comments

@tajmone
Copy link
Contributor

tajmone commented Dec 19, 2017

pandoc v2.0.5

When passing a .theme file during creation of an HTML document, the JSON styles for "Normal" are outputed in the final CSS as definitions for code span. (with a dot class-selector after span, but no class specified):

code span. { color: #ffffff; background-color: #333333; font-weight: bold; font-style: italic; text-decoration: underline; } /* Normal */

This is a bit confusing, and this use of the class selector seems dubious (I haven't managed to find any references to similar uses).

From pandoc/skylighting source, it is clear that pandoc ignores the "Normal" token — from skylighting's HTML.hs (line 50):

-- A 'NormalTok' is not marked up at all.

So, I'd expect all reference to "Normal" in the JSON theme file to be ignored in the final CSS output.

The point I'm trying to make here is that if you edit the actual CSS, and remove the "." after "code span", then the "Normal" styles become the base style for all <span> tags in the code block — and, for example, if you give to "Normal" a background color, then all tokens which don't explicitly define a background color will inherit it from "Normal", and the same goes for other styles of "Normal".

This isn't happening because of the "classless dot" in the CSS, it seems that the browser isn't able to resolve the class-less dot to a generic class for <span> tag. But my fear is that some browsers might handle differently the dotless class.

If the original intent was to ignore the "Normal" token and styling (as this seems the case, as normal text is simply otuside spans), and use the base style definitions instead (ie: those defined outside the "text-styles" JSON container), then the "Normal" text-styles should be ignored completely (IMO).

On the other hand, if the intention was that the styles of "Normal" were to define the base styles of the <span> tag (to be inherited by all code spans) then the dot is preventing it.

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

No branches or pull requests

2 participants