Skip to content

Optimizer drops some pseudo-element selectors. #31

Description

@cspiel

Hevea optimizes (option: -O) out some CSS classes that use
pseudo-element selectors; without optimization the generated
HTML code is fine.

Here comes an example:

\documentclass{article}

\usepackage{hevea}

\newstyle{:root}{--initialcapwidth: 60\%}% not optimized away
\newstyle{.initialcap}{margin: auto; width: var(--initialcapwidth)}
%%  Bug: next two newstyles are evicted by the optimizer (`-O').
\newstyle{.initialcap::first-letter}{font-size: 250\%}
\newstyle{.initialcap::first-line}{line-height: 120\%}

\newenvironment{initialcap}{\begin{divstyle}{initialcap}}{\end{divstyle}}

\begin{document}
\begin{initialcap}
  Well, you know or don't you kennet or haven't I told you every
  telling has a taling and that's the he and the she of it.  Look,
  look, the dusk is growing!  My branches lofty are taking root.  And
  my cold cher's gone ashley.  Fieluhr?  Filou!  What age is at?  It
  saon is late.
\end{initialcap}
\end{document}

Classes :root and .initialcap survive the optimization phase,
whareas .initialcap::first-letter and .initialcap::first-line are lost.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions