kane50613/takumi
 Watch   
 Star   
 Fork   
4 hours ago
takumi

takumi@2.14.0

  • @takumi-rs/wasm@2.14.0
  • takumi-js@2.14.0
  • @takumi-rs/core@2.14.0
  • @takumi-rs/image-response@2.14.0
  • @takumi-rs/helpers@2.14.0
  • takumi@2.14.0

Clip overflow at the padding box

overflow: hidden, overflow: clip and contain: paint now clip at the padding edge, as CSS specifies. Content that spilled into a padded box's padding used to be cut at the content edge.

Size boxes from their content or available space

width and height now accept min-content, max-content, fit-content, fit-content(<length-percentage>), and stretch.

.card {
  width: fit-content(20rem);
}

This fits the card to its content with a preferred limit of 20rem. Its min-content size remains the lower bound.

flex-basis accepts the same values, plus content to size a flex item from its content regardless of its main size property.

Tailwind utilities map to the new values:

Value Utilities
min-content w-min, h-min, size-min
max-content w-max, h-max, size-max
fit-content w-fit, h-fit, size-fit
content basis-content

min-width, max-width, min-height, and max-height do not accept the new keywords. Their existing length and percentage values still work.

Text wraps at the width layout measured

A box with a fractional width wrapped its text against the pixel-snapped content box at paint, so a nearly full line pushed its last word onto a line the layout never reserved and it overlapped the block below.

Upgrade taffy to 0.14

Layout picks up taffy's flexbox, grid and block fixes from 0.12 through 0.14.

Paint text that overflows a zero-size box

Text inside a zero-size box now renders in SVG output like it does in raster output.

Add balanced flex wrapping, flow-root, self-alignment, and containment

Spread flex items across balanced lines and set a minimum line count:

.cards {
  display: flex;
  flex-wrap: balance;
  flex-line-count: 2;
}

balance also combines with wrap or wrap-reverse, in either order. It cannot combine with nowrap.

  • display: flow-root makes the box a block formatting context root.
  • align-items, align-self, justify-items, and justify-self accept self-start and self-end to align to the item's own start or end. justify-content and align-content reject them.
  • contain accepts none, content, or a space-separated combination of layout, style, and paint, without duplicates. content means layout style paint.

contain: paint clips descendants to the padding box. Either layout or paint creates a stacking context and a containing block for absolute and fixed descendants.

Size containment is not implemented, so size, inline-size, and strict cause a parse error. style parses but has nothing to scope: Takumi has no author-facing counters, and list-item ordinals do not restart at the boundary.

Containment is a correctness feature here, not a performance hint. Takumi renders once, so there is no relayout to skip. Paint containment adds a stacking context and a clip layer per box.

Take an anonymous box's border width down to its used value

An anonymous box skipped the used-value pass, so it reported the initial medium border width even though it has no border style to render it with.

Place a measured inline box against its parent's content box

An inline box's transform omitted the parent's border and padding, so it was reported at the border-box origin while every other measured node carries an absolute transform.

Align flex items to the first line of a wrapped item

A flex item that wraps onto several lines now offers the baseline of its first line to align-items: baseline, instead of its bottom edge.

Reject repeated alignment overflow prefixes

Reject repeated safe and unsafe prefixes in CSS alignment values.

Decode character references in fromHtml image sources

An img whose src holds &amp; now yields the decoded URL, matching attributes.src.

Size a replaced element the way its source states it

An <svg> carrying only a viewBox states a ratio and no size, and as an inline box it took a size the ratio never stated. box-sizing: border-box counted an image's padding and border twice, so the picture came out taller than its box. A source stating neither a size nor a ratio had one synthesised from the default object size, so width alone moved height with it.

Keep balanced lines aligned within the container

text-wrap: balance aligned lines against the narrowed balancing width, so RTL, text-align: right, and centered paragraphs drifted toward the left edge.

Render canvases up to 64 megapixels

The canvas budget is now 64 megapixels, up from 16. A 7680 × 4320 banner or a 4096 × 16384 page fits.

Over the budget, render fails with InvalidViewport. The message now states the limit.

Keep decoded photos in the resource cache

The default cacheMaxBytes is now 64 MiB, and one decoded image can use the whole budget. The cache used to split its budget into many small shards and never kept an image larger than one shard, so most photos were decoded again on every render.

Size a table's remaining auto columns by their content

Auto columns next to a column with a declared width now share the free width in proportion to their max-content widths, as they already did when every column was auto.

Encode photographic PNG output faster and smaller

PNG output now picks its encoder settings from the image. Photo backgrounds encode about twice as fast and around 30% smaller. Flat art keeps its bytes. Animated PNG picks its settings from the first frame.

Stop anonymous boxes inheriting their parent's box model

Bare text inside a padded display: flex container measured against a content box narrowed by the parent's padding again, so a line that fit was laid out as two.

Balance text beside floats against the container

text-wrap: balance searched for its width with the floats squeezed into that narrower width, so paragraphs beside a float ended up barely balanced.

Resolve viewport units against the page area in paged output

100vh in paged content was 0 because the content column lays out at unbounded height; it now equals the page area height, as in print media.

4 hours ago
takumi

takumi-pdf@0.15.0

Trim an image to its content edge curve

A border-radius on an image was ignored unless the box also clipped its overflow, so a rounded picture came out square.

Fill a page exactly with a box as tall as the content window

A box sized to the page snapped to a whole pixel past the fractional window and opened an empty page after it.

Write the CIDFont default width as an integer

The PDF spec types /DW as an integer. Poppler ignores a real one and falls back to the spec default of 1000, so every glyph the entry covered advanced far too far in poppler-based viewers.

Text wraps at the width layout measured

A box with a fractional width wrapped its text against the pixel-snapped content box at paint, so a nearly full line pushed its last word onto a line the layout never reserved and it overlapped the block below.

Override the header and footer on some pages

pages takes { first, last, odd, even }, each overriding header or footer for the pages it covers. A band is a node tree, or false to draw none.

Accept object stylesheet rules in PDF bindings

Match the PDF binding's css type to the object rules already accepted at runtime.

Render uncovered characters with uncoveredText

A single character no registered font covers used to fail the whole render, which leaves a server rendering text someone else wrote with no way through. uncoveredText: "placeholder" draws the font's glyph 0 instead, and "blank" draws nothing. Both keep the character's width, so the line does not reflow. The default stays "error".

Every PDF/A level and both PDF/UA levels forbid glyph 0, so "placeholder" is now rejected there by name instead of failing as a generic write error.

Forced page breaks no longer open empty pages

A break-before: page or break-after: page with only spacing beside it on its page is dropped, and trailing spacing past the last content box no longer opens a page.

Resolve viewport units against the page area in paged output

100vh in paged content was 0 because the content column lays out at unbounded height; it now equals the page area height, as in print media.

8 days ago
takumi

takumi@2.13.7

  • @takumi-rs/helpers@2.13.7
  • @takumi-rs/core@2.13.7
  • takumi-js@2.13.7
  • @takumi-rs/wasm@2.13.7
  • @takumi-rs/image-response@2.13.7
  • takumi@2.13.7

Export the CssInput type from @takumi-rs/core

The css option referenced CssInput without importing it, so type checking failed on the declaration file when skipLibCheck was off.

8 days ago
takumi

takumi-pdf@0.14.3

Published takumi-pdf@0.14.3.

10 days ago
takumi

takumi@2.13.6

  • takumi-js@2.13.6
  • @takumi-rs/core@2.13.6
  • @takumi-rs/helpers@2.13.6
  • @takumi-rs/wasm@2.13.6
  • @takumi-rs/image-response@2.13.6
  • takumi@2.13.6

Retry transient font and image requests

Retry temporary GET and HEAD failures within the existing timeout, including Google Fonts metadata and font file downloads.

Keep Google Fonts cache entries within caller limits

Bound the default googleFonts CSS cache, isolate custom fetch implementations, and honor request policies on repeated calls.

Accept custom properties in node styles

Use Declarations consistently for node styles, presets, and style helpers so custom properties typecheck without casts.

Honor request policies across redirects and cache hits

Strip sensitive headers on cross-origin redirects, apply redirect method and body rules, and honor image cache readers' cancellation and timeout without aborting shared downloads.

10 days ago
takumi

takumi-pdf@0.14.2

Published takumi-pdf@0.14.2.

12 days ago
takumi

takumi-html@0.3.4

Published takumi-html@0.3.4.

12 days ago
takumi

takumi-svg@0.3.22

Published takumi-svg@0.3.22.

12 days ago
takumi

takumi-pdf@0.14.1

Resolve a browser-only entry in client builds

Bundlers that resolve the browser condition (Vite client, webpack web) now get bundlers/browser.mjs, which only fetches the .wasm asset by import.meta.url. Client builds with noExternal stop failing with Cannot bundle Node.js built-in "node:fs/promises". The Vite server entry reads the asset through process.getBuiltinModule, so no bundler sees a Node import. These packages, plus takumi-js and @takumi-rs/image-response on top of them, now require Node 20.19 or newer.

12 days ago
takumi

takumi-raster@0.5.1

Crop object-fit: cover the way the other backends do

A length object-position under cover or none now shifts the image the same direction as the SVG and PDF output. Keyword and percentage positions are unchanged.