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

Rework style (again) #377

Merged
merged 5 commits into from
Dec 6, 2023
Merged

Conversation

fenjalien
Copy link
Member

  • Reworks styling to work in a kind of simpler way.
  • Fixes wrong styling in an example in the manual
  • Added detailed description of how styling works

Copy link
Member

@johannes-wolf johannes-wolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small things only.
The changed arc test image does not match the output. Current reference images are still Typst 0.9.0.

tests/axes/test.typ Outdated Show resolved Hide resolved
src/styles.typ Show resolved Hide resolved
@@ -665,17 +666,21 @@
(calc.max(from.at(0), to.at(0)), calc.max(from.at(1), to.at(1)))
)

let style = styles.resolve(ctx.style, style)
if help-lines {
let style = styles.resolve(ctx.style, merge: style, root: "grid", base: (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not having this in the default style dictionary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really matter where the default of an element's style is. Really styles.default can just have stroke, fill, radius, padding, shorten and mark keys in it. Then use base for each element and it'll work just the same...

src/lib/axes.typ Show resolved Hide resolved
src/styles.typ Outdated Show resolved Hide resolved
@johannes-wolf johannes-wolf merged commit 540d68d into cetz-package:0.2.0 Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants