Skip to content

fix: Improve rendering of text in response to theme and CSS changes - #10579

Open
gonfunko wants to merge 3 commits into
mainfrom
theme-css
Open

gonfunko wants to merge 3 commits into
mainfrom
theme-css

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Proposed Changes

This PR fixes a whole bunch of tangentially related bugs related to text and element sizing depending on themes and CSS. In particular:

  • When a Blockly theme is set that has the same name as the current theme, its CSS will be injected, overwriting the old values for that theme.
  • When a theme is set that specifies a font style (e.g. size), the bounds of all fields on the current set of blocks will be invalidated, causing the change to font style to be immediately reflected. This fixes the Rendering > font Size slider on the advanced playground, which has been broken since v10.
  • When a theme's text size changes, warning bubbles and comments have their text resized accordingly.
  • If text on certain blocks is targeted with CSS to apply specific font attributes, those will be respected, and the blocks will be sized to fit their text.
  • letter-spacing and word-spacing in a user stylesheet (or the stylesheet of a site that uses Blockly) are respected when rendering blocks.

A demo of all of the above:

scaling.mov

Reason for Changes

We should support letter-spacing and word-spacing for accessibility, themes should work as documented, and blocks and other workspace elements should respond to text size changes and resize to fit their contents.

@gonfunko
gonfunko requested a review from a team as a code owner October 15, 2026 21:44
@gonfunko
gonfunko requested a review from mikeharv October 15, 2026 21:44
@github-actions github-actions Bot added the PR: fix Fixes a bug label Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

2 participants