DEV Community

Cover image for The <sarcasm> ๐Ÿ™„ component - now Brits can finally be understood on the web!
GrahamTheDev
GrahamTheDev

Posted on

37 11 6 8 9

The <sarcasm> ๐Ÿ™„ component - now Brits can finally be understood on the web!

I don't think 'Muricans understand our struggle as Brits.

We make a killer sarcastic comment like "I love listicles, they are super useful" and they think we are being serious!

Now most of my European friends will recognise the sarcasm, but as a Brit I do find that my cousins from across the pond struggle with identifying sarcasm, especially in written text.

And the scariest part of that is that they might actually think I like listicles ๐Ÿคข.

They should make me Prime Minister

Do not fear though, dear reader, I have solved the problem. I will be forever heralded as the saviour of USA-UK relations!

My creation is that ground breaking that I truly believe I would make a better PM than Mr Starmer (although that isn't a high bar to be fair! ๐Ÿ˜ฑ๐Ÿคฃ)!

At the very least I think I am in the running for a Nobel Peace Prize?

Prepare yourself to marvel at the majesty and beauty of the <sarcasm> component!

The sarcasm component

Did you cry?

I know I did when I saw it take it's first breath. The beauty of helping 70 million Brits finally express themselves was overwhelming.

Air quotes in HTML should have been a thing since day 1 of the internet!

It is bad enough I have to write color every day and spell things incorrectly, but I could have easily forgiven that if my needs and those of my fellow Countrymen had been considered elsewhere.

I have finally solved that injustice!

Go forth and multiply

To all my fellow Brits (and other sarcastic so and so's!) - go forth and spread the good word.

Use the component everywhere you can and rejoice in your ability to fully express yourself.

And you can rest assured you can use it without fear as:

  • It hides the SVGs from screen readers and adds a visually hidden "(sarcasm)" to the end so it is pretty screen reader friendly (open to suggestions on how to improve it though!).
  • If you remove the rotate(1.5deg) it would be even more accessible FYI.
  • It will adapt to font sizes and colours so will look ugly great in anything you do.
  • Comes with my standard 3 year warranty*

* this warranty, as with most warranties, is completely useless as we provide no guarantees either implied or explicit and is included purely for marketing purposes

That's a wrap.

A silly article (as to be expected from me) just to get back into the swing of writing and to say hi.

I hope 2025 is treating you well so far and I look forward to writing some more "useful and well thought out" articles and sharing with you all soon. (see why we need the sarcasm component?)

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (32)

Collapse
 
darkwiiplayer profile image
๐’ŽWii ๐Ÿณ๏ธโ€โšง๏ธ โ€ข

in practice, the component should probably detect if the language is set to en-UK or en-US and show or hide the visual aids accordingly :)

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

OMG why did I not think of that, genius idea! ๐Ÿคฃ๐Ÿ’—

Collapse
 
ben profile image
Ben Halpern โ€ข

This is good

Collapse
 
dariomannu profile image
Dario Mannu โ€ข

Actually, autistic people are the ones who would love this the most. Brilliant idea!

<sarcasm> for web standards, not just a playful web component

May also think of an aria-actual-meaning attribute:

<p>
  Oh, that's just
  <sarcasm aria-actual-meaning="ridiculous">the best idea ever</sarcasm>.
</p>
Enter fullscreen mode Exit fullscreen mode

Shame that whoever's being sarcastic would unlikely be using these tags... ๐Ÿคž๐Ÿ˜๐Ÿ˜‚

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข โ€ข Edited

I love the levelling up of the idea here! Would be nice to see if I can find a standards compliant way of doing this (perhaps, dare i say it, with title attribute or a custom implementation of the behaviour!) ๐Ÿ’—

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer โ€ข โ€ข Edited

I remember a German/Denglish version with a more subtle syntax: </irony> (or </ironie>), but without an opening tag, just like @valeriavg 's </Not sarcasm> reply.

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

I like the idea of it being a void element, except for the fact that means I can't have my air quotes!

Honestly the feedback on this silly idea has been so great I now actually feel like it is a thing! haha

Collapse
 
valeriavg profile image
Valeria โ€ข

I love this article! Itโ€™s very useful ๐Ÿ˜‰

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

Haha, as with all my articles right? RIGHT?? ๐Ÿคฃ๐Ÿ’—

Collapse
 
valeriavg profile image
Valeria โ€ข

Most certainly๐Ÿ‘Œ

Thread Thread
 
grahamthedev profile image
GrahamTheDev โ€ข

And look at that, we already found a use case for <sarcasm>! hahahah

Thread Thread
 
valeriavg profile image
Valeria โ€ข โ€ข Edited

Jokes aside, I had fun reading it and I liked the subtle push for a11y. Well done!
</Not sarcasm>

Thread Thread
 
grahamthedev profile image
GrahamTheDev โ€ข

I like to do things subtla11y and slowly win people over ๐Ÿ˜๐Ÿ’—

Collapse
 
riobrewster profile image
RioBrewster โ€ข

I have to disagree on your premise. Sarcasm is alive and well in the US. (Granted, the Biden years have made it more difficult to detect.)

However, this component would be extremely useful in email and especially for assistive technology. Maybe we can slip it into ARIA.

Collapse
 
webjose profile image
Josรฉ Pablo Ramรญrez Vargas โ€ข

I like it for sure. The next step is to make it wildly available in Mardkown-to-HTML libraries, and of course, decide on the Markdown syntax.

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

~s sarcastic comment inside s~??
Donโ€™t worry we will expand into all formats! ๐Ÿคฃ๐Ÿ’—

Collapse
 
savvy-itch profile image
Michael Savych โ€ข

So nice to find some quality content for once here (not sarcasm)

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

Haha, I am now thinking we need a <genuinely> component to counter the <sarcasm> one! haha

Collapse
 
fyodorio profile image
Fyodor โ€ข

But then you wonโ€™t be able to prevent sarcastic use of the <genuinely> component ๐Ÿค”

Thread Thread
 
grahamthedev profile image
GrahamTheDev โ€ข

It then becomes a game of triple bluff? ๐Ÿคท๐Ÿคฃ๐Ÿ’—

Collapse
 
riobrewster profile image
RioBrewster โ€ข โ€ข Edited

Actually <seriously> would be more performant.

Collapse
 
doekenorg profile image
Doeke Norg โ€ข

I can only assume the JS api for this component has an innit() method?

Collapse
 
grahamthedev profile image
GrahamTheDev โ€ข

Nah, that is the <UrbanBrit> component, I am impressed you know of it! ๐Ÿคฃ๐Ÿ’—

Collapse
 
leob profile image
leob โ€ข

Brilliant, this made my day ... and I'm honestly not being sarcastic here!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.