Skip to content

Change primitives.css to use imports - #1247

Merged
lukasoppermann merged 4 commits into
mainfrom
primitives.css-import
Sep 19, 2025
Merged

lukasoppermann merged 4 commits into
mainfrom
primitives.css-import

Conversation

@lukasoppermann

@lukasoppermann lukasoppermann commented Aug 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Change primitives.css to use imports and add viewport.css

This is one step in https://github.com/github/primer/issues/4506

@langermank is there any reason you removed viewports from primer.css? It is added in dotcom in the index.scss

List of notable changes:

What should reviewers focus on?

Steps to test:

Copilot AI review requested due to automatic review settings August 26, 2025 09:34
@lukasoppermann
lukasoppermann requested review from a team as code owners August 26, 2025 09:34
@changeset-bot

changeset-bot Bot commented Aug 26, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e5e19d2

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

This PR includes changesets to release 1 package
Name Type
@primer/primitives 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the CSS build system to use imports in primitives.css and re-enables viewport.css. The change simplifies CSS loading by consolidating multiple imports into a single primitives.css file and restores viewport styles that were previously excluded.

  • Modified build script to generate import statements instead of concatenating CSS content
  • Re-enabled viewport.css by commenting out its exclusion filter
  • Updated Storybook preview to use the consolidated primitives.css import

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/buildTokens.ts Modified to generate CSS imports and re-enable viewport.css in the build
docs/storybook/.storybook/preview.css Simplified to use single primitives.css import instead of multiple individual imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/buildTokens.ts Resolved
Comment thread scripts/buildTokens.ts Resolved
@langermank

Copy link
Copy Markdown
Contributor

@lukasoppermann yeah, the viewports export uses a special syntax that requires a PostCSS plugin to consume, so it feels risky to put it in an index.

@github-actions
github-actions Bot temporarily deployed to Preview (Storybook) September 15, 2025 15:40 Inactive
@github-actions
github-actions Bot temporarily deployed to Preview (Storybook) September 15, 2025 15:41 Inactive
@lukasoppermann
lukasoppermann enabled auto-merge (squash) September 16, 2025 13:19
@langermank langermank changed the title Change primitives.css to use imports and add viewport.css Change primitives.css to use imports Sep 17, 2025
@lukasoppermann
lukasoppermann merged commit d1deb93 into main Sep 19, 2025
@lukasoppermann
lukasoppermann deleted the primitives.css-import branch September 19, 2025 08:56
@primer primer Bot mentioned this pull request Sep 15, 2025

This branch was previously deployed

2 inactive deployments
Preview (Storybook) — e5e19d21 Deployed Sep 15, 2025 by github-actions[bot]
github-pages — e5e19d21 Deployed Sep 15, 2025 by lukasoppermann
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.

3 participants