Skip to content

Selectors only work on inherent fields, not on set rule or default fields #1024

Closed

Description

@yujqiao

Description

image

#show text.where(style: "normal"): it => [
  #set text(fill: red)
  #it
]

#text(style: "normal")[
  Hello, World
]

#show text: it => [
  #set text(fill: red)
  #it
]

#text(style: "normal")[
  Hello, World
]

The first "Hello, World" should also be red.

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Apr 28, 2023
  2. added
    scripting
    on May 9, 2023
  3. changed the title [-]Selector on text does not work[/-] [+]Selectors only work on inherent fields, not on set rule or default fields[/+] on Sep 28, 2023
  4. RubixDev commented on Sep 28, 2023

    @RubixDev

    Another example of effectively the same thing: a filtered show rule does not respect default values. (the box should be rendered in every case)

    image

    #show raw.where(block: false): box.with(fill: luma(220), inset: (x: 3pt, y: 0pt), outset: (y: 3pt), radius: 2pt)
    
    This is `fn main() {}` some text.
    
    This is ```rust fn main() {}``` some text.
    
    This is #raw("fn main() {}") some text.
    
    This is #raw("fn main() {}", block: false) some text.
    
    This is #raw("fn main() {}", lang: "rust") some text.
    
    This is #raw("fn main() {}", lang: "rust", block: false) some text.
  5. added
    styling
    and removed
    scripting
    on Sep 28, 2023
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

    bugstyling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions