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

Primitives variables missing in bundled css #2648

Closed
yanyongyu opened this issue Jun 22, 2024 · 6 comments · Fixed by #2657
Closed

Primitives variables missing in bundled css #2648

yanyongyu opened this issue Jun 22, 2024 · 6 comments · Fixed by #2657

Comments

@yanyongyu
Copy link

yanyongyu commented Jun 22, 2024

Describe the bug

I'm using the built primer css file on my static site following the documentation. and i'm upgrading to the latest 21 version (currently 21.3.3). I found many primitives css variables is missing since this version (21.3.2 or 21.3.3). Should i import the primitives variables by my self? If so, which css file should i add to my html header? The documentation seems not up-to-date.

To Reproduce

add <link href="https://unpkg.com/@primer/css@^21.0.1/dist/primer.css" rel="stylesheet" /> to static site html

Expected behavior

primitives variables loaded.

Additional context

it seems it works after i add https://unpkg.com/@primer/css@^21.0.1/dist/primitives.css to html.

related to cscs181/QQ-GitHub-Bot#83

@siddharthkp
Copy link
Member

Hi!

Tagging @langermank and @lukasoppermann on this, they have more context.

@lukasoppermann
Copy link
Contributor

lukasoppermann commented Jun 27, 2024

I had to explicitly set the data-color-mode and data-light/dark-theme in a parent element (<main data-color-mode="light" data-light-theme="light">)

This has been like this in the primer/primitives css for quite a while already.

I am wondering if this changed for primer/css consumers because of the change in the theme files like here: https://github.com/primer/css/pull/2634/files#diff-09f47f7344ab01d99503302193dff74105e131684928fbfb55c02aaac33f0799 ?

@jonrohan can you advise if this may be the cause for the change?

@yanyongyu
Copy link
Author

In my case, I have already provided the data-color-mode and theme info in the html tag attribute. You can see the static html file here.

I didn't make any changes to this and it is not working since the primer css new version (21.3.2 or 21.3.3) released.

@StephanTLavavej
Copy link

I'm also observing that I need to load https://cdn.jsdelivr.net/npm/@primer/[email protected]/dist/primitives.min.css in addition to https://cdn.jsdelivr.net/npm/@primer/[email protected]/dist/primer.min.css while attempting to update the microsoft/STL Status Chart. (Color variables were also renamed.)

primer/css 21.3.2 specifically contained the breaking change.

@lukasoppermann
Copy link
Contributor

CC: @langermank @jonrohan

@jonrohan
Copy link
Member

jonrohan commented Jul 8, 2024

This should be fixed with v21.3.5

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 a pull request may close this issue.

5 participants