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

Use oklch for the Jenkins UI #10078

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

janfaracik
Copy link
Contributor

@janfaracik janfaracik commented Dec 19, 2024

I've really wanted to do this one for a while, combination of waiting for tooling and browser support to catch up. This PR uses oklch for colours to ensure that our palette is consistent (e.g. colours used for tables, cards, buttons all inherit from the same colour and only have to be defined once).

This change won't have much visual impact on Jenkins, but it will ensure that things are consistent in a way that wasn't easy to do so before. You'll notice slight hue changes here and there across the UI, and actual colours will pop a little bit more depending on if your display supports it.

View comparison

This change also makes it easier for theme developers, say if a developer wanted to develop an 'Accent colour' plugin they'd only need to update one variable (--accent-color) and Jenkins would reflect that across the UI.

image

Changing the accent colour property can have quite an impact on the overall interface now

Why oklch?

  • OKLCH frees designers from the need to manually choose every color. Designers can define a formula, choose a few colors, and an entire design system palette is automatically generated.
  • OKLCH can be used for wide-gamut P3 colors. For instance, new devices (like those from Apple) can display more colors than old sRGB monitors, and we can use OKLCH to specify these new colors.
  • Unlike hsl(), OKLCH is better for color modifications and palette generation. It uses perceptual lightness, so no more unexpected results, like we had with darken() in Sass.
  • Further, with its predictable lightness, OKLCH provides better a11y.
  • Unlike rgb() or hex (#ca0000), OKLCH is human readable. You can quickly and easily know which color an OKLCH value represents simply by looking at the numbers. OKLCH works like HSL, but it encodes lightness better than HSL.

From https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl

Testing done

  • Tried in Safari + Chrome
  • Tried in Firefox + Firefox ESR

Proposed changelog entries

  • Use oklch for the Jenkins UI

Proposed upgrade guidelines

N/A

Submitter checklist

Preview Give feedback

Desired reviewers

@jenkinsci/sig-ux

Before the changes are marked as ready-for-merge:

Maintainer checklist

Preview Give feedback

@janfaracik janfaracik added web-ui The PR includes WebUI changes which may need special expertise rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted labels Dec 19, 2024
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

does dark theme need a similar PR?

(I haven't run this yet but the comparison screenshots look identical to me

@janfaracik
Copy link
Contributor Author

does dark theme need a similar PR?

It doesn't need one (e.g. still looks fine), but I want to create one to bring over oklch + one for jenkins.io for consistency.

(I haven't run this yet but the comparison screenshots look identical to me

Yeah the hue of the UI is very slightly different, not intended to be noticeable by the user but it does make our UI's theme more consistent.

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants