Add Colors to js #17
No reviewers
Labels
No Label
Bug
Component
Config
Good First Issue
Low-Priority
Page
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: www/cs-2022-class-profile#17
Loading…
Reference in New Issue
No description provided.
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The global colors pr will have to be merged before this one.
After further investgation, the solutions that we planned on using (
getComputedStyle(document.documentElement) .getPropertyValue(property);
) did not end up working, because of some wierd issues with nextjs. However, luckly it seems we can still just use the css variables inside the js (I tried it out with Amy's bar graph demo and it seemed to work well).Thus I created a typesafe helper, utils/Colors.ts , anytime you need a color, you can use this object, eg.
And importantly the Colors is typesafe so you can get autocomplete once you do Colors. :) (Protip: press Cntrl + Space if you want autocomplete to pop up when it isnt coming)
Pull request closed