Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Jul 2, 2021

@apreshill as discussed.

I have used the same logic as Quarto, with icon built in (using inline svg). I have looked at the code there, and reuse part of it

I have kept the style of bs4_book() though, with the tooltip and background, and just change the text by an icon, which changes in click for a few seconds.

Example: https://cderv.github.io/bs4booktesting/icon-copy-btn/

We need to deal with the overlap discussed in #1187 (this PR could replace the other or complement only)

Same logic as Quarto
@cderv cderv added this to the v0.23 milestone Jul 2, 2021
@cderv cderv requested a review from apreshill July 2, 2021 12:23
@apreshill
Copy link
Contributor

Here is what I'm thinking, will change the css to:

  • remove the border always
  • remove the background color always

I think this will address issue #1040 pretty well.

@cderv
Copy link
Collaborator Author

cderv commented Jul 2, 2021

So something like this ?
image

Currently, this style of button is used : https://getbootstrap.com/docs/4.0/components/buttons/#outline-buttons

EDIT: it is now removed https://cderv.github.io/bs4booktesting/icon-copy-btn/

Copy link
Contributor

@apreshill apreshill left a comment

Choose a reason for hiding this comment

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

I really like how this looks and works- thank you! Are you thinking we would tackle the text/icon overlap in a separate PR?

@cderv
Copy link
Collaborator Author

cderv commented Jul 2, 2021

Are you thinking we would tackle the text/icon overlap in a separate PR?

Yes in #1187 after merging this and updating the PR. Keeping things separate in smaller PR seems better to me in order to change the different things on the copy button.

@hadley does this icon and behavior looks ok to you ?
I prefer to check before merging as this would change the look of your books (which build on bookdown dev version I recall).

@hadley
Copy link
Member

hadley commented Jul 4, 2021

LGTM

@cderv cderv changed the title bs4_book: Copy button as an icon instead of text bs4_book: Copy button uses an icon instead of text Jul 5, 2021
@cderv cderv merged commit 78a350c into master Jul 5, 2021
@cderv cderv deleted the bs4book/change-copy-btn branch July 5, 2021 14:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants