Skip to content

Safari 14.1 support#1

Merged
microbit-matt-hillsdon merged 2 commits into
mainfrom
legacy-safari-postcss-export
Jul 22, 2026
Merged

Safari 14.1 support#1
microbit-matt-hillsdon merged 2 commits into
mainfrom
legacy-safari-postcss-export

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Contributor

This keeps the baseline more or less where it already was - we're already in a bad place with Safari 13.x.

14.0 is significantly harder (no gap).

Consuming apps that still support Safari <15 need to work around two Panda
output issues: @layer (dropped wholesale below 15.4) and logical shorthands
with var() (silently dropped on 14.x). The de-layering is off-the-shelf
(@csstools/postcss-cascade-layers); the logical-shorthand expansion is not,
so centralise it here rather than have each app re-derive the workaround.

- New ./postcss-legacy-safari export: a dependency-free PostCSS plugin
  (expandLogicalShorthands) that rewrites inline/block logical shorthands to
  their -start/-end longhands, kept logical so RTL still flips. Plain .cjs so
  app postcss configs can require() it; adds no dependency to the package.
- README: a 'Legacy browser support' section with the full app-side recipe
  (postcss plugins + build.cssTarget floor) and how to remove it all.

Named 'legacy-safari' deliberately: this is expected to be deleted once apps
raise their support floor past the affected browsers.
The lightningcss transformer (which forced the Panda CLI) is gone, so use
@pandacss/dev/postcss to generate the CSS instead of cssgen + a static import:
- Storybook: add postcss.config.cjs (@pandacss/dev/postcss only — modern, no
  legacy plugins); panda script is codegen-only; preview.tsx drops the
  styled-system.css import (layers.css is the plugin's injection entry).
- README: rewrite the setup to the plugin approach (codegen prepare-step +
  the plugin + a layer-declaration entry import; don't set the lightningcss
  transformer), and fix the CLI/codegen-vs-cssgen wording, the layers.css
  path reference, and a step-1 typo. The Legacy section's postcss.config now
  shows the plugins added after Panda's.

Verified by build-testing the Storybook: Panda CSS injected, native @layer
kept (modern), no legacy flattening.
@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit 65100fc into main Jul 22, 2026
1 check passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the legacy-safari-postcss-export branch July 22, 2026 16:20
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