-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: color modes docs #1186
WIP: color modes docs #1186
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-css/rdjeaawx3 |
/cc folks who might have opinions on this: @colebemis @emplums @auareyou @broccolini @simurai |
</PaletteCell> | ||
{colorModes.map(mode => ( | ||
<PaletteCell as="th" {...colorProps} key={mode}> | ||
{capitalize(mode)} Mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: move capitalize
to CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this make state-hoverPrimaryBg
into state-hover-primary-bg
? That would be nice for copy&pasta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the kebabCase function from lodash to convert hoverPrimerBg
to hover-primer-bg
in https://primer.style/primitives
Hmm.. yeah, I have the same concerns. I think initially we should encourage people to only use the "global" variables. The rest is kinda "private". I also wonder... now that all the variables got moved to Otherwise the docs itself look nice. ✨ |
I agree. I'm trying this out now, will see how it goes. I want to find a good balance between having docs that are useful and well presented as well as docs that don't go out of date when we change Primer Primitives 🙈
Good question. /cc @colebemis for thoughts. Is the plan to add the Primer Primitives docs to the primer.style homepage, or was this a temporary or experimental thing? |
I created primer.style/primitives as a temporary way to reference color variables. But I think it could make sense to build it out into something more permanent. Then we can link to it from the Primer CSS docs. |
Agree as well! What I was hoping for is to write a guide on how to use the global variables and use for our color docs as well. I have a lot of hoarded notes I can provide to either help with this or help wrtiing it . |
Thanks, @auareyou, I'd love any notes you've collected! I'll be putting the finishing touches on a first go next week. |
…/color-modes-docs
@@ -0,0 +1,262 @@ | |||
--- | |||
title: Primer v16 Migration Guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the URL for this file? I still find myself needing to refer to the new names like color-text-secondary
instead of text-gray
, and the old URL I was using, https://github.com/primer/css/blob/mkt/color-modes-docs/docs/content/support/v16-migration.mdx#utility-classes, now 404s. 🙇♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheshire137 Ahh.. sorry. Updated the links. Eventually it will show up in https://primer.style/css, but for now you can see it with this preview URL: https://primer-css-git-release-1600-primer.vercel.app/css/support/v16-migration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This PR is a WIP for improving the Primer CSS "Support -> Color system", "Support -> Variables", and "Utilities -> Colors" pages for a post-color-modes world.
Color scales
Now that most of the usable colors are represented by functional variables, there's less of a need to document the individual color scale values. However, I've included them just in case they're needed for some dotcom hacks.
These tables are automatically generated based on the values from Primer Primitives.
Functional variables
I had more trouble when starting to look into documenting the functional variables. There are a huge number of them, and arguably some of them probably shouldn't really be used by end-users of the system at all. For example,
--color-calendar-graph-day-L2-bg
serves a very specific purpose and that color shouldn't be used for any other components, even if the color matches, so does it need to be documented at all? Further, some of the values aren't colors at all, e.g.--color-btn-primary-shadow
is0 1px 0 rgba(27,31,35,0.1)
(and, again, is for a specific component, so should it be documented at all?)For this category of colors, I'm starting to lean toward hand-written documentation, detailing how to pick one of the reusable functional colors (e.g. how do I pick between
text-primary
vstext-secondary
vstext-tertiary
) rather than just generating a huge list of all the functional colors.Variables
For the "Support -> Variables" page, I think we can keep this the way it is, just with the Sass color variables removed (but leave the other Sass variables, like
$spacer-*
etc).