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

[JENKINS-71479] Do not use SCSS lighten function directly to avoid invalid CSS #8425

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

dwnusbaum
Copy link
Member

@dwnusbaum dwnusbaum commented Aug 23, 2023

See JENKINS-71479.

#7850 in 2.402 migrated frontend styles from LESS to SCSS, but accidentally broke the generated CSS styles for --btn-primary-bg-hover and --btn-primary-bg-active. Before that PR, the generated styles in styles.css were as follows:

--btn-primary-bg:#063f61;
--btn-primary-bg-hover:#085685;
--btn-primary-bg-active:#0a649b;

After that PR, the generated styles are these:

--btn-primary-bg:#063f61;
--btn-primary-bg-hover:lighten(#063f61,7.5%);
--btn-primary-bg-active:lighten(#063f61,12%);

As far as I understand, the latter is invalid CSS, and in my case it seems to be treated as transparent, resulting in buttons disappearing on hover.

With this PR, styles.css again has the intended colors:

--btn-primary-bg:#063f61;
--btn-primary-bg-hover:#085685;
--btn-primary-bg-active:#0a649b;

Testing done

I tested this change manually against a (proprietary) plugin with a button with these CSS classes: yui-button yui-submit-button submit-button primary. Before the change, the buttons become invisible on hover, and after the change, they show the lighter color on hover as intended.

Proposed changelog entries

  • Fix invalid CSS which caused some buttons to become invisible on hover

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@janfaracik

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

Maintainer checklist

@dwnusbaum dwnusbaum added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Aug 23, 2023
Comment on lines +119 to +120
--btn-primary-bg-hover: #{lighten(#063f61, 7.5%)};
--btn-primary-bg-active: #{lighten(#063f61, 12%)};
Copy link
Member Author

@dwnusbaum dwnusbaum Aug 23, 2023

Choose a reason for hiding this comment

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

I am far from an SCSS expert, so IDK whether this is the right way to do things, but it does fix the issue.

@dwnusbaum dwnusbaum mentioned this pull request Aug 23, 2023
14 tasks
@janfaracik
Copy link
Contributor

Hey! Thanks so much for raising and implementing the fix. This all looks good to me 👍

I'd recommend adopting the new jenkins-button classes where possible (https://weekly.ci.jenkins.io/design-library/Buttons/) instead of the yui-button classes. It's very much a long term plan but the eventual idea is to reduce/remove usages of YUI from core.

@dwnusbaum
Copy link
Member Author

dwnusbaum commented Aug 23, 2023

Ah I suspect that this is also the cause of JENKINS-71479, reported by @NotMyFault. I'll double-check and update the PR title if so.

(EDIT: I confirmed that it is indeed the same issue)

@dwnusbaum dwnusbaum changed the title Do not use SCSS lighten function directly to avoid invalid CSS [JENKINS-71479] Do not use SCSS lighten function directly to avoid invalid CSS Aug 23, 2023
@NotMyFault NotMyFault requested a review from a team August 23, 2023 21:46
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.

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 23, 2023
@timja timja merged commit 620e775 into jenkinsci:master Aug 24, 2023
17 checks passed
@dwnusbaum dwnusbaum deleted the fix-btn-primary-bg-css branch August 24, 2023 14:28
krisstern pushed a commit to krisstern/jenkins that referenced this pull request Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants