Skip to content

Hovercards: Implement a component-scoped CSS reset#198

Merged
wellyshen merged 3 commits intotrunkfrom
add/hovercards-css-reset
Apr 30, 2025
Merged

Hovercards: Implement a component-scoped CSS reset#198
wellyshen merged 3 commits intotrunkfrom
add/hovercards-css-reset

Conversation

@wellyshen
Copy link
Contributor

@wellyshen wellyshen commented Apr 28, 2025

This PR implements a (robust) component-scoped CSS reset to prevent the hovercard's styles from being overridden by the themes of the website (e.g., WordPress sites)

Proposed Changes

  • Implement the component-scoped CSS reset
  • Remove redundant and unnecessary CSS props due to the newly added CSS reset
  • Use full class names to make parsing easier for the code editor
  • Improve the styles a little bit

Testing Instructions

  • Check out this PR
  • Run cd web/packages/hovercards && npm run build
  • Open a new terminal, and run npm start
  • Check the hovercards it still works the same:
截圖 2025-04-29 凌晨1 41 25 截圖 2025-04-29 凌晨1 41 31
  • Check the error state, it still works the same:
截圖 2025-04-29 凌晨1 41 12
  • Check the loading state, it still works the same:
截圖 2025-04-29 凌晨1 41 56

@wellyshen wellyshen self-assigned this Apr 28, 2025
@wellyshen wellyshen requested a review from a team April 28, 2025 18:00
@github-actions
Copy link

github-actions bot commented Apr 28, 2025

Size Change: 0 B

Total Size: 64 kB

ℹ️ View Unchanged
Filename Size
dist/index.esm.js 9.38 kB
dist/index.js 9.52 kB
dist/index.mjs 9.38 kB
dist/index.react.js 11.6 kB
dist/index.react.mjs 11.6 kB
dist/index.react.umd.js 6.76 kB
dist/index.umd.js 5.79 kB

compressed-size-action

@wellyshen wellyshen linked an issue Apr 28, 2025 that may be closed by this pull request
@wellyshen wellyshen changed the title Hovercards: implement a component-scoped CSS reset Hovercards: Implement a component-scoped CSS reset Apr 29, 2025
}

.gravatar-hovercard__body {
min-height: 42px;
Copy link
Contributor Author

@wellyshen wellyshen Apr 30, 2025

Choose a reason for hiding this comment

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

This was for the version before portrait mode and is no longer necessary.

Copy link

@aaronfc aaronfc left a comment

Choose a reason for hiding this comment

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

Looks good works well! 🚀

@wellyshen wellyshen merged commit 07e3030 into trunk Apr 30, 2025
2 checks passed
@wellyshen wellyshen deleted the add/hovercards-css-reset branch April 30, 2025 17: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.

Hovercards: Create a component scoped CSS reset

2 participants

Comments