css icon indicating copy to clipboard operation
css copied to clipboard

Primitives variables missing in bundled css

Open yanyongyu opened this issue 1 year ago • 4 comments

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 https://github.com/cscs181/QQ-GitHub-Bot/pull/83

yanyongyu avatar Jun 22 '24 04:06 yanyongyu

Hi!

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

siddharthkp avatar Jun 27 '24 12:06 siddharthkp

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?

lukasoppermann avatar Jun 27 '24 12:06 lukasoppermann

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.

yanyongyu avatar Jun 27 '24 13:06 yanyongyu

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.

StephanTLavavej avatar Jul 06 '24 01:07 StephanTLavavej

CC: @langermank @jonrohan

lukasoppermann avatar Jul 08 '24 06:07 lukasoppermann

This should be fixed with v21.3.5

jonrohan avatar Jul 08 '24 22:07 jonrohan