Is this expected behaviour?

Using XPP 9.4 in CSS mode if I have:

para::before { counter-reset: tester 5; content: counter(tester); }

then I get the 5 output before the start of the text, however if I have:

para::after { counter-reset: tester 5; content: counter(tester); }

then the output is zero.

I don't understand why I can't load a value into a counter in the "after" selector - am I missing something?

Parents
  • Chris (and Bart), as far as I can tell XPP composition is not processing any counter-reset or counter-increment properties at all that occur within an ::after pseudo element.

    Entering your ticket with Customer Support was the right action.

    It does seem a bit "unusual" to want to use counter-reset and/or counter-increment in an ::after pseudo element.

    I imagine it's an oversight (i.e. there was no known "use case" at the time of implementation), but I'm not all that familiar with CSS and specifically in the context of XPP composition, so we'll need to make sure that there's not any reason that it would cause a "problem" to add it (i.e. "fix the apparent bug").

    Jonathan Dagresta
    SDL XPP Engineering

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • Well I have been thinking a bit more on this problem and maybe because in this case we are working 'after' the element, the system is addressing a different level of the counter.
    After all for mulit-level numbered list we use the same named counter, but the system keeps track of the level in which we use this 'named counter' and outputs (or resets) the correct value for a particular level of the named counter. All of this without us as users having to care about which level we are in.

    It is unclear to me when the system decides to use multi level named counters or just a single level counter.
    (could be tricky if you want to use the same unique counter at different levels in your document...?) 

    It would be nice if engineering can give us some more info on this

  • As far as the additional info goes, well it seems to be there (although not in the CSS/counter section with examples). Additional info can be found in the xymacro manual on page 4-92:Screenshot of Trados Studio manual page showing 'Set Named Counter Number Register' section with format, arguments, and comments.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 5:17 AM (GMT 0) on 5 Mar 2024]
Reply Children
No Data