Skip to content

fix(breakpoints): keep fractional values from themes - #262

Merged
nk-o merged 1 commit into
masterfrom
fractional-breakpoints
Sep 14, 2026
Merged

nk-o merged 1 commit into
masterfrom
fractional-breakpoints

Conversation

@nk-o

@nk-o nk-o commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Ghost Framework themes (Horr, CyberPulse and the others built on it) set Ghost Kit's breakpoints through the gkt_default_breakpoint_* filters, and CyberPulse hands over fractions such as 777.98 so its max-width queries never overlap its min-width ones at fractional viewport widths. The SCSS compiler wrote those values as given; the replacement from #259 cast them to integers, so every query moved by a fraction of a pixel and no longer matched the theme's own. The value is now kept as the theme gave it: 777.98 stays 777.98px, "700" and 700.0 become 700px, a non-numeric value leaves the default in place.

Checked with the real Ghost_Framework_Breakpoints class and CyberPulse's numbers loaded as an mu-plugin on a wp-env site: Ghost Kit reports {"xs":567.98,"sm":777.98,"md":1077.98,"lg":1387.98}, the generated uploads/ghostkit/build/gutenberg/style.css served on a page with a Ghost Kit block carries (max-width:567.98px), (max-width:777.98px), (max-width:1077.98px), (max-width:1387.98px), and the editor variable resolves to (max-width: 777.98px). Unit test added; npm run test:unit:php OK (68 tests, 128 assertions), npm run lint:php clean.

Belongs in 3.7.2 (#261) since the integer cast never shipped.

Ghost Framework themes such as CyberPulse hand Ghost Kit breakpoints
like 777.98 through the gkt_default_breakpoint_* filters, so their
max-width queries never overlap the min-width ones at fractional
viewport widths. The SCSS compiler wrote them as given; the replacement
cast them to integers and shifted every query by a fraction of a pixel.
@nk-o
nk-o merged commit e542b78 into master Sep 14, 2026
7 checks passed
@nk-o
nk-o deleted the fractional-breakpoints branch September 14, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant