dayjs / dayjs-website

⏰Day.js website repo
http://day.js.org/
MIT License
65 stars 228 forks source link

Feature: Having a copy button next to the code sample #104

Closed Manuel-Suarez-Abascal closed 1 year ago

Manuel-Suarez-Abascal commented 1 year ago

Description:

This proposal is to add a "Copy" button to the top-right corner of code sample boxes in the official documentation. The button's text should change to "Copied" when clicked, allowing the user to paste the copied code wherever they like. An example of this can be seen in the VueJS documentation.

UAT:

Given: A Copy button is displayed in the top-right corner of the code sample boxes. When: a user clicks on the button its text should change to Copied. Then: the user can paste the copied code anywhere he/she wants.

Please let me know if this proposal is clear and if there are any additional details that need to be included. Thanks!

Visual example from VueJS docs:

https://user-images.githubusercontent.com/32891808/207880734-0bd9ceab-1bc1-479f-8673-3363221359a3.mov

Manuel-Suarez-Abascal commented 1 year ago

@iamkun I'm willing to take on this issue. Please let me know if there are any specific implementation requirements that I need to follow.

iamkun commented 1 year ago

looks cool, pr is welcomed 😁