JeffreyWay's avatar

Forum Updates - Themes and "Copy to Clipboard"

Hey, everyone! Just a couple quick forum additions:

Copy to Clipboard

I added a "Copy Code" button to all code snippets in the forum. I'm not sure how often you'll need this, but it's an option now. Here's an example snippet using some of the actual clipboard code behind the scenes, haha.

import { ref } from "vue";

export function useClipboard(text) {
  let copied = ref(false);

  let supported = navigator && "clipboard" in navigator;

  let copy = () => {
    if (supported) {
      navigator.clipboard.writeText(text);

      copied.value = true;
    }
  };

  return { copy, copied, supported };
}

Light / Dark Mode

You've surely noticed that we've been experimenting with a dark mode for the forum this last week. That research is mostly wrapped up now. I have a few smaller tweaks to make, but it's mostly finished. There was enough push-back on the dark theme that we decided to offer a light/dark toggle, which you'll find on the main forum overview page. Just look for the little moon icon at the top. This setting is saved to your profile, so your choice will be reflected across all devices.

That's all for now. 👍

0 likes
14 replies
Tippin's avatar

@jeffreyway Thank you for all that you and your team do! The copy code is definitely helpful, I will use it as I like to copy paste into my IDE on occasion when trying to formulate a response.

4 likes
krs's avatar

...aaaand here's a little extra content for the vue3 series ;-) Great!

1 like
bicicura's avatar

Thanks for giving attention to these details which require a lot of effort. I appreciate it!

5 likes
johnDoe220's avatar

In my opinion, Laracasts is the most diligent educational website in the world right now, and this is quite commendable, a valuable update.

5 likes
dincho186's avatar

Thank you for giving attention to details. Dark mode looks so freaking awesome!

Keep up the good work, love being part of Laracasts community!

1 like
krs's avatar

Did you know, that in the preview text of a thread there are quotes displayed as html entities &quot? Is that on purpose?

camiant's avatar

copy button is a nice and useful addition👍🏻

dark theme deserves a standing ovation for @jeffreyway : huge amount of work👏🏻

2 likes
JeffreyWay's avatar

@camiant Thank you. But @_adrian is responsible for the design. I'm just the lowly code monkey who wrote the HTML. :)

3 likes
_adrian's avatar

@JeffreyWay haha, thanks Jeffrey, but without your skills, everything is just a jpeg.

4 likes
sidneygijzen's avatar

Looks great! Thanks a lot for bringing back the light theme.

Please or to participate in this conversation.