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

fix(live-samples): make Copied! message visible + use theme #5590

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

OnkarRuikar
Copy link
Contributor

Summary

Fixes #5537

Code section "Copied!" message is not visible for multiline code sections.
Change the message foreground and background colors according to theme.

Problem

The message was staying behind the code section due to z-index set to -1000.
Colors are hardcoded so they don't change as per theme.

Solution

Remove z-index property from the CSS rule ..copy-icon-message.
Also set color using CSS vars.


Screenshots

Before

The message was not visible.

After

  1. Light Theme:
    Light theme

  2. Dark Theme:
    Dark theme

@caugner caugner self-requested a review March 12, 2022 23:35
@caugner caugner added the 🧑‍🤝‍🧑 community contributions by our wonderful community label Mar 13, 2022
@OnkarRuikar
Copy link
Contributor Author

@caugner First commit was not signed. So I signed it later.
Do I need to delete the first unsigned commit?
Or do I need to make a brand new pull request?

@caugner
Copy link
Contributor

caugner commented Mar 14, 2022

@OnkarRuikar Here's what I would do:

# Switch to branch (and make sure you don't have any uncommitted changes).
git checkout fix-#5537
# Reset the branch.
git reset --hard main
# Cherry-pick your signed commit.
git cherry-pick 82d455e3764b954729a950403741f76f61e0418a
# Overwrite the remote branch.
git push --force

edit: Afterwards this PR should only have one signed commit. No need to create a new PR. :)

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

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

LGTM, I will merge once you have followed the steps to reduce the branch to a single signed commit (if you can).

@OnkarRuikar
Copy link
Contributor Author

@caugner done Thx!

@caugner caugner added the live-samples issues related to live samples (EmbedLiveSample macro) label Mar 14, 2022
@caugner caugner changed the title fix: #5537 Code section Copied! message is not visible fix(live-samples): make Copied! message visible + use theme Mar 14, 2022
@caugner caugner self-requested a review March 14, 2022 10:14
@caugner caugner merged commit 7891636 into mdn:main Mar 14, 2022
@OnkarRuikar OnkarRuikar deleted the fix-#5537 branch March 14, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍🤝‍🧑 community contributions by our wonderful community live-samples issues related to live samples (EmbedLiveSample macro)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Code section "Copied!" message is not visible for multiline code sections
2 participants