primer / prism

A tool for creating and maintaining cohesive, consistent, and accessible color palettes
https://primer.style/prism/
MIT License
667 stars 39 forks source link

adds an index above each scale step #40

Closed bryanberger closed 2 years ago

bryanberger commented 2 years ago

Adds a string above each scale step to indicate which index in the scale.colors array the color is. I opted to wrap the existing scale ZStack in order to separate it from that container (so the points don't interfere with it.

Screen Shot 2022-06-22 at 8 46 59 PM )

ref: https://github.com/primer/prism/discussions/32

bryanberger commented 2 years ago

I also tried adding these below the scale steps but it seemed too cluttered down there. Thoughts? Screen Shot 2022-06-22 at 8 52 02 PM

bryanberger commented 2 years ago

Thanks for the <Box/> tips @colebemis!

I ran into a slight issue, because the color steps have a variable width, we run into an alignment issue when lifting a div above them.

Screen Shot 2022-06-23 at 10 48 11 PM Screen Shot 2022-06-24 at 10 20 36 AM

I might try and add these to the :before content, but I prefer not to introduce more negative absolute positioning.

Also...we solved the variable width in our fork by rotating the contrast spans vertically instead (so the width doesn't fluctuate based on contrast score text, and also renamed AA Large to just AA+ for brevity) I can add that to this PR as well if you think it's a good direction. Screen Shot 2022-06-24 at 10 16 59 AM

colebemis commented 2 years ago

image

I love this solution! Feel free to add it to this PR 💖

bryanberger commented 2 years ago

Latest screenshot with mentioned changes:

Screen Shot 2022-06-27 at 10 18 55 PM