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

Show-set rules don't seem to work for table.cell #4159

Open
1 task done
MatejKafka opened this issue May 16, 2024 · 1 comment
Open
1 task done

Show-set rules don't seem to work for table.cell #4159

MatejKafka opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working styling About set and show rules or style properties

Comments

@MatejKafka
Copy link

MatejKafka commented May 16, 2024

Description

The following code results in the strong text being red (as expected), but the table cell fill remains unset. I'm aware I could just use a set rule for this, but in the actual code I'm also using a selector, which currently does not work with set rules.

#{
  show table.cell: set table.cell(fill: red)
  table("1", "2", "3")

  show strong: set text(fill: red)
  strong("test")
}

image

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst
@MatejKafka MatejKafka added the bug Something isn't working label May 16, 2024
@PgBiel
Copy link
Contributor

PgBiel commented May 16, 2024

Unfortunately this just hasn't been implemented yet, but it will be in the future, for sure.

In the meantime, if your selector only relies on the cell's position, you can use e.g. #set table(fill: (x, y) => if x == 0 { red } else { blue }).

@Enivex Enivex added the styling About set and show rules or style properties label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working styling About set and show rules or style properties
Projects
None yet
Development

No branches or pull requests

3 participants