Skip to content

Conversation

@djdjz7
Copy link

@djdjz7 djdjz7 commented Dec 28, 2025

Current default target for Lightning CSS

The current default target for Lightning CSS is resolved by converting the default ESBuild targets to Lightning CSS targets. However, the default ESBuild targets does not differentiate between Safari and Safari on iOS:

export const ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET: string[] = [
  'chrome111',
  'edge111',
  'firefox114',
  'safari16.4',
]

Thus the converted default Lightning CSS targets does not include Safari on iOS, or ios_saf.

The problem is, Safari on iOS and Safari have some slightly different behaviors when handling CSS. For example, the text-size-adjust property. As of now:

  • Chrome supports the unprefixed text-size-adjust
  • Safari on iOS supports the prefixed -webkit-text-size-adjust
  • Safari does not support text-size-adjust
  • Firefox supports the prefixed -moz-text-size-adjust
image

The upper window is for Safari on iOS, and the lower for Safari

However, Lightning CSS treats Safari on iOS and Safari differently, introducing some problems with vendor prifixing. With the default targets, Lighting CSS does not provide prefix for -webkit, only for -moz:

image

Adding the ios_saf target

We can resolve the issue by simply providing a default target for ios_saf, taking the same value of safari, if not otherwise specified
image

About this PR

This PR copies the targets.safari value to targets.ios_saf value when converting ESBuild targets to Lightning CSS targets, if ios_saf is not otherwise specified.

This PR passes relevant tests.

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