Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to compiled stylesheet #825

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Conversation

rezrah
Copy link
Collaborator

@rezrah rezrah commented Nov 20, 2024

Summary

Addresses multiple issues in the compiled stylesheet, including:

  • Removal of escaped characters in selectors where modern CSS features like :has are used
  • Switched to use CSS Logical Properties in compiled output, which is both necessary to fix the above and is now worth doing as the feature is widely available in modern browsers.

Compiled CSS output size is now 9% lower than before.

Fixes #823

List of notable changes:

  • Updates relevant postcss dependency in order to prevent rewriting of :has selectors. Previous versions are deprecated, so an upgrade was needed.
  • Adds rule to preserve source usage of :has and logical properties

What should reviewers focus on?

  • Diff the current production bundle with the canary equivalent

Steps to test:

  1. Copy this (current) and enter into left hand side of a diff checker
  2. Copy this (canary) and enter into right hand side of a diff checker
  3. Manually compare the output and verify that only changes are:
  • direct use of logical properties
  • escaped chars have been removed
  • some other legacy rules have been removed, but nothing that is relevant to modern browsers

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Before After

Screenshot 2024-11-22 at 11 59 59

Screenshot 2024-11-22 at 11 59 06

Copy link

changeset-bot bot commented Nov 20, 2024

🦋 Changeset detected

Latest commit: 7430ffd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Minor
@primer/brand-primitives Minor
@primer/brand-e2e Minor
@primer/brand-fonts Minor
@primer/brand-config Minor
@primer/brand-storybook Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

🟢 No design token changes found

Copy link
Contributor

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@rezrah rezrah merged commit 2c8e924 into main Nov 22, 2024
18 checks passed
@rezrah rezrah deleted the rezrah/fix-escaped-chars-css-output branch November 22, 2024 12:49
@primer-css primer-css mentioned this pull request Nov 22, 2024
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.

🐛 [BUG] - Escaped characters appearing in compiled CSS output
2 participants