playfulprogramming icon indicating copy to clipboard operation
playfulprogramming copied to clipboard

[Feature Request]: Dont-try-this-at-home codeblocks

Open davidveen opened this issue 1 year ago • 4 comments

Description

Codeblocks containing pseudocode, conscious errors, or other don't-try-this-at-home ideas are a great teaching tool, but might benefit from a visual indication aside from (con)textual hints. It should be clear enough so that a reader scrolling through code examples doesn't end up copying non-working code or patterns marked as 'bad'.

Describe the solution you'd like

A warning triangle in the corner or a different border would go a long way. Here be dragons! 🐉

Describe alternatives you've considered

No response

davidveen avatar Feb 19 '24 16:02 davidveen

Assigning @PrattiDev as he's our design lead for the site, which is where this would start (Ed, no priority on this; just wanna get your thoughts on this whenever you get time)

crutchcorn avatar Feb 20 '24 23:02 crutchcorn

@crutchcorn I will begin to check GitHub more often — this is the first time I'm seeing this! Seems easy to do. 👍

edpratti avatar Aug 24 '24 20:08 edpratti

image

Does this work for you @davidveen @crutchcorn ? Thankfully the system already has tokens for error states for everything under the sun so it was a matter of switching tokens. It also reuses the tooltip component we built for outgoing links.

edpratti avatar Aug 24 '24 21:08 edpratti