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

refactor: use external color handling #1611

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

haxxmaxx
Copy link
Collaborator

@haxxmaxx haxxmaxx commented Sep 16, 2024

Motivation

The Color class has been modernized and moved to qlik-chart-modules. This means we can remove Color class and some other color stuff that was implemented twice.

Adding qlik-chart-modules to the deps does increase the bundle size. It is noticeable but too acceptable...

Requirements checklist

  • Api specification
    • Ran yarn spec
      • No changes OR API changes has been formally approved
  • Unit/Component test coverage
  • Correct PR title for the changes (fix, chore, feat)

When build and tests have passed:

  • Add code reviewers, for example @qlik-oss/nebula-core

@@ -200,65 +194,64 @@ describe('styling', () => {
});
});

const hasEnoughContrast = (a, b) => getContrast(a, b) > CONTRAST_THRESHOLD;
// const hasEnoughContrast = (a, b) => getContrast(a, b) > CONTRAST_THRESHOLD;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: potentially move some of these tests to chart-modules

@@ -116,14 +110,14 @@ describe('styling', () => {
expect(styles.search.color).toEqual('object.listBox,content,color');
});
it('search - should get desired color if contrasting enough', () => {
themeApi.getStyle = () => '#999';
themeApi.getStyle = () => '#888888';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the contrast for this was actually pretty bad (< 3:1) which isn't acceptable in any case. Probably due to the incorrect contrast calculations, and the arbitrary threshold, this was considered good enough

@haxxmaxx haxxmaxx marked this pull request as ready for review October 2, 2024 12:58
@haxxmaxx
Copy link
Collaborator Author

haxxmaxx commented Oct 4, 2024

Putting this back to draft since it requires quite a lot of testing to mitigate the risk. Starting with this PR #1625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant