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

WIP | feat: update css to latest #5142

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

castastrophe
Copy link
Contributor

@castastrophe castastrophe commented Mar 3, 2025

Description

This is a full upgrade of all packages to use the latest published CSS from the @spectrum-css project.

Why update everything at once?

It is often easier to see changes in components that influence one-another (i.e., --mod passthrough styles from parent components) if we bump all components together.

That does not mean that all components need to be merged via this PR but rather, that all components can be viewed in unison via this PR.

Related issue(s)

Most related issues exist in Jira but this is a nice view of the scope of updates we are still needing in order to be up-to-date with the latest fast-follows design updates and CSS theming optimizations (these optimizations have removed hundreds of extemporaneous custom properties.

How has this been tested?

  • Strongly recommend relying heavily on the VRT results and sanity-checking the Storybook pages by clicking through some of the more problematic components (especially those with nested SWC components or styles from multiple CSS packages).

  • Strongly suggest design review this Storybook for their most important components and validate the S2 versions are as they wish. This PR is up-to-date with the latest fast-follows that have been merged.

  • Did it pass in Desktop?

  • Did it pass in Mobile?

  • Did it pass in iPad?

Screenshots (if appropriate)

Types of changes

  • Bug fix (the semver designation as this update bumps the preview theme for S2 which is not the foundational theme in this release as-yet).
  • Breaking S2 design change (this does not translate to the semver used but is an important distinction)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • [n/a] If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • [n/a] I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@castastrophe castastrophe self-assigned this Mar 3, 2025
Copy link

changeset-bot bot commented Mar 3, 2025

⚠️ No Changeset found

Latest commit: d5fea20

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

Copy link

github-actions bot commented Mar 3, 2025

Branch preview

Review the following VRT differences

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

github-actions bot commented Mar 3, 2025

Tachometer results

Currently, no packages are changed by this PR...

Copy link

github-actions bot commented Mar 3, 2025

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.98 0.99
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 242.542 kB 229.562 kB 218.299 kB 🏆
Scripts 60.706 kB 54.274 kB 54.019 kB 🏆
Stylesheet 45.813 kB 40.776 kB 29.772 kB 🏆
Document 6.251 kB 5.529 kB 🏆 5.535 kB
Font 126.819 kB 126.633 kB 126.622 kB 🏆

Request Count

Category Latest Main Branch
Total 52 52 52
Scripts 41 41 41
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

@castastrophe castastrophe force-pushed the feat-update-css-to-latest branch 21 times, most recently from 1987d3a to d74a21d Compare March 7, 2025 17:54
@castastrophe castastrophe force-pushed the feat-update-css-to-latest branch 4 times, most recently from eaebcbe to 8dd0fe4 Compare March 16, 2025 12:50
>
Enable
</sp-button>
<sp-button-group slot="button">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buttons are not correctly spaced in the slot without the button-group wrapper so this seemed like a good update (especially in terms of demonstrating best practices to customers).

package.json Outdated
@@ -385,7 +388,7 @@
]
},
"process-spectrum": {
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn lint:css --fix && pretty-quick --pattern \"{packages,tools}/**/*.css\" && pretty-quick --pattern \"packages/dialog/src/spectrum-dialog.css\"",
"command": "node ./scripts/spectrum-vars.js && node ./tasks/process-spectrum.js && node ./scripts/generate-tokens.js && yarn lint:css --fix && pretty-quick --pattern \"{packages,tools}/**/*.css\"",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the additional pretty-quick run against spectrum-dialog because it's already included in the pattern for the previous pretty-quick run.

.prettierrc.yaml Outdated
@@ -6,3 +6,7 @@ trailingComma: es5
bracketSpacing: true
arrowParens: always
htmlWhitespaceSensitivity: ignore
overrides:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier's line wrapping for CSS does not have exceptions for var functions; adding whitespace or newlines to var functions cannot be minified safely downstream (and many minifiers won't) because whitespace is valid in a CSS var function. By increasing the line-length for CSS, we prevent invalid newlines being adding into var functions.

package.json Outdated
Comment on lines 69 to 71
"spectrum-css": "wireit",
"spectrum-tokens": "wireit",
"spectrum-vars": "wireit",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands don't exist in wireit and haven't for a long while - seems safe to remove the alias'es right?

@@ -12,6 +12,7 @@
"analyze": "lit-analyzer \"{packages,tools}/*/src/**/!(*.css).ts\"",
"build": "wireit",
"build:clear-cache": "rimraf packages/*/tsconfig.tsbuildinfo && rimraf tools/*/tsconfig.tsbuildinfo",
"build:component:css": "node ./tasks/process-spectrum.js",
Copy link
Contributor Author

@castastrophe castastrophe Mar 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted the ability to force-run the build only for specific components as a means of validating updates to the spectrum-config files. This has been documented in the README.

package.json Outdated
Comment on lines 100 to 102
"peerDependencies": {
"common-tags": "^1.8.0"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies consumers checking out the monorepo root would need to install common-tags locally for themselves in order to be able to build this project but I don't believe that is the case. Can we remove this? I don't think the monorepo root has any required peerDeps.

@castastrophe castastrophe force-pushed the feat-update-css-to-latest branch 9 times, most recently from f339cb3 to b61baca Compare March 19, 2025 16:40
@castastrophe castastrophe force-pushed the feat-update-css-to-latest branch from b61baca to f518619 Compare March 20, 2025 21:07
@castastrophe castastrophe force-pushed the feat-update-css-to-latest branch from f518619 to d5fea20 Compare March 20, 2025 21:14
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