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

[UI] Add new themes to Packages List view page #9852

Merged

Conversation

martinrrm
Copy link
Contributor

@martinrrm martinrrm commented Mar 13, 2024

Addresses #9854
Figma: https://www.figma.com/file/ZaAD9rDujh8JDkRF4q9Fd8/NuGet---Simple-theme-updates?type=design&node-id=61%3A9109&mode=design&t=Urj8iIoXc4thBO3E-1
Spec: https://github.com/NuGet/Engineering/pull/5209

Description

These PR add's colors/theme for the Package List view, for this page we added:

  • transparent button
  • new styles for checkbox and radio buttons
  • new style for switch.
  • new theme for badges.

Dark Theme

image

Light Theme

image

Transparent button

States

State Dark Light
Focused image image
Hover image image
Pressed image image
Rest image image

Checkbox, Switch and TreeView

The icon button uses the new transparent button so the styles are the same.

Dark

checkbox-dark-theme

Light

checkbox-light-theme

Radio button

radiobutton-dark-theme

Badges

image
image

Accessibility errors

Links color are not accessible enough

I'll contact designers again to ask for guidance here. There are two options, add an underline for these kinds of links or change the color of hyperlinks
image

@martinrrm martinrrm marked this pull request as ready for review March 13, 2024 23:07
@martinrrm martinrrm requested a review from a team as a code owner March 13, 2024 23:07
@@ -4,7 +4,7 @@
value="@(String.IsNullOrEmpty(ViewBag.SearchTerm) ? "" : ViewBag.SearchTerm)"
@(ViewBag.AutofocusSearch == true ? "autofocus" : string.Empty) />
<span class="input-group-btn">
<button class="btn btn-default btn-brand btn-search" type="submit"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

btn-default adds styles that are not needed, removing it to reduce the overriding of css properties

<label for="prerel-checkbox" aria-label="Options: Include prerelease">Include prerelease</label>
<label class="brand-checkbox" aria-label="Options: Include prerelease">
<input id="prerel-checkbox" type="checkbox" checked="@Model.IncludePrerelease">
<span>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added spans so we can select the text from CSS, otherwise is rendered just as text

@erdembayar
Copy link
Contributor

Please add link to main tracking issue and if there's any spec.

@@ -926,6 +926,10 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version

// Load all packages with the ID.
var allVersions = _packageService.FindPackagesById(id, includePackageRegistration: true);
includePackageRegistration: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

need to remove this too, bad rebase

@@ -49,6 +49,9 @@ p {
line-height: 22px;
/* 137.5% */
}
label {
color: var(--neutralForeground1Rest);
Copy link
Member

Choose a reason for hiding this comment

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

Since we are using less, what's the benefit of using var(...)? Can't we leave the explicit color and get a bit more legacy support that way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Talked with Joel offline and we decided to continue with CSS variables, IE is the main concern since it doesn't support them, after merging into dev we will verify that the page is usable I'll track it here #9875

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

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

Do we use var in our CSS at all? I see it's supported on most recent browser versions but it seems strange to use this feature along with LESS transpiler, i.e. we are already "compiling" our CSS so why not sub the variables for real values for a bit of back compat. I don't feel super strongly but I'd like to at least understand the motivation of using this CSS feature for I believe the first time.

Do you plan on merging the PR as-is with the a11y errors or are you blocking on that?

Copy link
Contributor

@drewgillies drewgillies left a comment

Choose a reason for hiding this comment

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

This looks good to me, pending @joelverhagen's clarifications.

src/Bootstrap/less/forms.less Show resolved Hide resolved
@martinrrm martinrrm merged commit 8a6ddd0 into dev-martinrrm-feature-new-theme Mar 21, 2024
2 checks passed
martinrrm added a commit that referenced this pull request Apr 30, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 7, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 7, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 8, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 10, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 16, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request May 22, 2024
* Add new theme to Package List page
martinrrm added a commit that referenced this pull request Jun 21, 2024
* Add new theme to Package List page
@joelverhagen joelverhagen deleted the dev-martinrm-dark-mode-packagelist branch August 22, 2024 16:34
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.

4 participants