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

[BSv5] Refactor Click-to-copy #1447

Merged
merged 1 commit into from
May 31, 2023
Merged

Conversation

geriom
Copy link
Collaborator

@geriom geriom commented Feb 28, 2023

Refactor of PR #1245. Bootstrap5-compatible code.

Closes #1267

Copy link
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Works nicely. See inline comments, thanks.

@@ -1,101 +1,84 @@
// Code formatting.

.td-content {
// Highlighted code.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to follow what has changed in this file. Could you consider not reformatting it in this PR so that the diffs are more clearly seen?

Did you only change the lines for the c2c button?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's nothing new in this file. I deleted all the styles for the tooltip and prettified it.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
transition: visibility 0s, opacity 0.5s linear;
}
// click-to-copy button
button {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer that you use a class name specific to this feature (and add the class via the js):

Suggested change
button {
button.td-click-to-copy {

Copy link
Collaborator Author

@geriom geriom Mar 6, 2023

Choose a reason for hiding this comment

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

Updated here and added the class in the js file

@@ -148,6 +148,24 @@ guessSyntax: true
{{< /tab >}}
{{< /tabpane >}}

If you are using a Docsy version later than `0.6.0`, the code blocks show a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
If you are using a Docsy version later than `0.6.0`, the code blocks show a
If you are using a Docsy version `0.6.0` or later, code blocks show a

Copy link
Collaborator Author

@geriom geriom Mar 6, 2023

Choose a reason for hiding this comment

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

This does not work for 0.6.0 and we haven't definitely decided on the next version number. I think "later than" covers that. About the article "the", although I know I don't really need it here, I try to never omit it based on this guideline: https://developers.google.com/style/articles

userguide/content/en/docs/adding-content/lookandfeel.md Outdated Show resolved Hide resolved
assets/js/click-to-copy.js Outdated Show resolved Hide resolved
@chalin
Copy link
Collaborator

chalin commented Mar 2, 2023

I've merged #1454. Apologies for the resulting merge conflicts, but as I mention in the PR, I should have done this earlier.

@chalin
Copy link
Collaborator

chalin commented Mar 5, 2023

@geriom - a more general question, why not use clipboardjs.com?

@geriom
Copy link
Collaborator Author

geriom commented Mar 6, 2023

@geriom - a more general question, why not use clipboardjs.com?

I don't think we need an additional dependency for a straightforward feature. I can see how that library would be very helpful for single-page applications with lots of dynamic content, but here I don't see a big benefit.

Refactor of PR google#1245. Bootstrap5-compatible code.
Copy link
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

@chalin chalin changed the title Refactor Click-to-copy with Bootstrap5 [BSv5] Refactor Click-to-copy May 31, 2023
@chalin chalin merged commit 5092f4b into google:main May 31, 2023
6 checks passed
@chalin chalin mentioned this pull request May 31, 2023
50 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reactivate code-block copy feature
2 participants