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

[PM-11000] AnonLayout Icon/Logo theme refactor #10549

Merged
merged 8 commits into from
Aug 31, 2024

Conversation

rr-bw
Copy link
Contributor

@rr-bw rr-bw commented Aug 16, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11000

📔 Objective

Adds a new tailwind class, marketing-logo, to handle automatically styling marketing related logos based on the theme. This allows us to remove the ThemeStateService, which was a bit cumbersome and required a workaround to check for the specific theme if the user had set their theme to system.

In this PR, the marketing-logo class is being used for both the Bitwarden Logo and the Bitwarden Shield Icon.

Note:

  • Removing the ThemeStateService means that Storybook will now show the correct color logo for both light and dark panels.

🎨 Storybook

https://62a88a6de5b807fa98886113-oxxsbpsfli.chromatic.com/?path=/story/auth-anon-layout--with-primary-content

📷 Screencast

web-themes.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@rr-bw rr-bw marked this pull request as ready for review August 16, 2024 19:35
@rr-bw rr-bw requested review from a team as code owners August 16, 2024 19:35
Copy link
Contributor

github-actions bot commented Aug 16, 2024

Logo
Checkmarx One – Scan Summary & Details09a14400-350a-4cea-a2c1-4078fe5d387e

No New Or Fixed Issues Found

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 33.13%. Comparing base (e7d4f85) to head (26386a1).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...h/src/angular/anon-layout/anon-layout.component.ts 0.00% 4 Missing ⚠️
...wrapper/extension-anon-layout-wrapper.component.ts 0.00% 3 Missing ⚠️
...on-layout-wrapper/extension-bitwarden-logo.icon.ts 0.00% 1 Missing ⚠️
...uth/src/angular/anon-layout/anon-layout.stories.ts 0.00% 1 Missing ⚠️
libs/auth/src/angular/icons/bitwarden-logo.icon.ts 0.00% 1 Missing ⚠️
...bs/auth/src/angular/icons/bitwarden-shield.icon.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10549   +/-   ##
=======================================
  Coverage   33.12%   33.13%           
=======================================
  Files        2687     2687           
  Lines       82975    82947   -28     
  Branches    15765    15756    -9     
=======================================
- Hits        27489    27482    -7     
+ Misses      53320    53299   -21     
  Partials     2166     2166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielleflinn
Copy link
Member

Looks great! Thanks @rr-bw and @vleague2 for the collaboration on this

@rr-bw rr-bw changed the title AnonLayout Icon/Logo theme refactor [PM-11000] AnonLayout Icon/Logo theme refactor Aug 16, 2024
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"

Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Is this change supposed to be in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is fine, but not part of my changes. This happened on another PR and Dani gave some context here: #10492 (review)

Copy link
Contributor

@quexten quexten Aug 19, 2024

Choose a reason for hiding this comment

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

I went ahead and merged the latest main into this PR which already has the cargo lock changes applied, so they are out of the diff. The one whitespace line in index.d.ts still remains as that has not been updated in main yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@quexten Thanks!

quexten
quexten previously approved these changes Aug 19, 2024
@quexten
Copy link
Contributor

quexten commented Aug 19, 2024

Nice work! Seems the linting automation failed because the github action had networking issues. Might want to just re-run the action.

<path d="M82.2944 69.1899V37.2898H60V93.9624C63.948 91.869 67.4812 89.5927 70.5998 87.1338C78.3962 81.0196 82.2944 75.0383 82.2944 69.1899ZM91.8491 30.9097V69.1899C91.8491 72.0477 91.2934 74.8805 90.182 77.6883C89.0706 80.4962 87.6938 82.9884 86.0516 85.1649C84.4094 87.3415 82.452 89.4598 80.1794 91.5201C77.9068 93.5803 75.8084 95.2916 73.8842 96.654C71.96 98.0164 69.9528 99.304 67.8627 100.517C65.7726 101.73 64.288 102.552 63.4088 102.984C62.5297 103.416 61.8247 103.748 61.2939 103.981C60.8958 104.18 60.4645 104.28 60 104.28C59.5355 104.28 59.1042 104.18 58.7061 103.981C58.1753 103.748 57.4703 103.416 56.5911 102.984C55.712 102.552 54.2273 101.73 52.1372 100.517C50.0471 99.304 48.04 98.0164 46.1158 96.654C44.1916 95.2916 42.0932 93.5803 39.8206 91.5201C37.548 89.4598 35.5906 87.3415 33.9484 85.1649C32.3062 82.9884 30.9294 80.4962 29.818 77.6883C28.7066 74.8805 28.1509 72.0477 28.1509 69.1899V30.9097C28.1509 30.0458 28.4661 29.2981 29.0964 28.6668C29.7267 28.0354 30.4732 27.7197 31.3358 27.7197H88.6642C89.5268 27.7197 90.2732 28.0354 90.9036 28.6668C91.5339 29.2981 91.8491 30.0458 91.8491 30.9097Z" fill="#175DDC"/>
export const BitwardenShield = svgIcon`
<svg viewBox="0 0 120 132" xmlns="http://www.w3.org/2000/svg">
<path class="tw-fill-marketing-logo" d="M82.2944 69.1899V37.2898H60V93.9624C63.948 91.869 67.4812 89.5927 70.5998 87.1338C78.3962 81.0196 82.2944 75.0383 82.2944 69.1899ZM91.8491 30.9097V69.1899C91.8491 72.0477 91.2934 74.8805 90.182 77.6883C89.0706 80.4962 87.6938 82.9884 86.0516 85.1649C84.4094 87.3415 82.452 89.4598 80.1794 91.5201C77.9068 93.5803 75.8084 95.2916 73.8842 96.654C71.96 98.0164 69.9528 99.304 67.8627 100.517C65.7726 101.73 64.288 102.552 63.4088 102.984C62.5297 103.416 61.8247 103.748 61.2939 103.981C60.8958 104.18 60.4645 104.28 60 104.28C59.5355 104.28 59.1042 104.18 58.7061 103.981C58.1753 103.748 57.4703 103.416 56.5911 102.984C55.712 102.552 54.2273 101.73 52.1372 100.517C50.0471 99.304 48.04 98.0164 46.1158 96.654C44.1916 95.2916 42.0932 93.5803 39.8206 91.5201C37.548 89.4598 35.5906 87.3415 33.9484 85.1649C32.3062 82.9884 30.9294 80.4962 29.818 77.6883C28.7066 74.8805 28.1509 72.0477 28.1509 69.1899V30.9097C28.1509 30.0458 28.4661 29.2981 29.0964 28.6668C29.7267 28.0354 30.4732 27.7197 31.3358 27.7197H88.6642C89.5268 27.7197 90.2732 28.0354 90.9036 28.6668C91.5339 29.2981 91.8491 30.0458 91.8491 30.9097Z" fill="#175DDC"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This still has a hardcoded hex for fill, should that be gone now that we are using the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching that! Fixed here: 5828e32

@rr-bw rr-bw requested a review from vleague2 August 21, 2024 16:30
@rr-bw rr-bw requested a review from quexten August 21, 2024 20:42
@rr-bw rr-bw removed request for a team and justindbaur August 31, 2024 00:06
@rr-bw rr-bw merged commit c5a267b into main Aug 31, 2024
66 checks passed
@rr-bw rr-bw deleted the auth/anon-layout-icon-theme-sync branch August 31, 2024 19:26
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