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

Audits: Add a report to generate statistics on alpha values #57

Merged
merged 2 commits into from
Oct 31, 2021

Conversation

ryelle
Copy link
Collaborator

@ryelle ryelle commented Oct 21, 2021

This PR adds a new audit to get an idea of the various opacities used in wp-admin CSS. The generated values are:

  • Number of unique alphas
  • List of all alpha values
  • Number of colors with opacity
  • List of all colors with opacity

Screen Shot 2021-10-21 at 13 56 39
Screen Shot 2021-10-21 at 13 56 44

@ryelle ryelle self-assigned this Oct 21, 2021
@ryelle ryelle requested review from laras126 and danfarrow and removed request for laras126 October 21, 2021 18:04
const values = node.nodes
.filter( ( n ) => 'numeric' === n.type )
.map( ( n ) => Number( n.value ) );
if ( values.length === 4 ) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will stop working once we start implementing the custom properties, but we can revise it when we get there.

Copy link
Collaborator

@danfarrow danfarrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s looking good to me!

@danfarrow danfarrow merged commit 6a1ef6a into trunk Oct 31, 2021
@danfarrow danfarrow deleted the add/alphas-report branch October 31, 2021 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants