Skip to content

[future specs] `content: element(something, all) #5

@julientaq

Description

@julientaq

Since we’re creating a new value for element in #2, i was wondering how all could be used without once

  • all: generate an element with all the elements with the position property with the right value for the variable.

  • once: only draw the element once and then forget about it.

This would let an author reuse a whole set of content for all the book. So, for instance, we could have book tabs using the following code:

h2 {
     string-set: sideTitles contents;
}

@page {
    @right-center {
        content: element(sideTitles, all);
    }
}

This would also allow for all (without once) that would repeat all the elements on all the pages (or all the named paged). A good use case for that would be printed tabs for scholar books or dictionary without any custom specifc or complex elements.

Image

note String-set only keeps the content of an element and retains no tags of it (no italic, bold, etc. — at least in paged.js) We may want to change that at some point to get the innerHTML instead of the textContent.

note i used string-set by oviously running would be better, or some other way to clone a content.


we could do the same with once, to use the value of an element only once, but i haven’t found a use case for that yet outside of experimental graphic design experiment / practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions