Tailwind: is there any special reason behind enclosing 'raw' key in single quotation?

34 views Asked by At

in the Tailwind custom media queries documentation, we are given an option to create a fully custom breakpoint using the 'raw' key.

I added this in my configuration file and when I save file, Prettier automatically removes the single quotation (' ') from raw key. So, ('raw') becomes (raw).

I wanted to ask that is it all fine - or should it be exactly enclosed in single quotation.

If anyone can explain reason, I'll be highly thankful.

I explored the Tailwind docs but couldn't find a satisfactory answer.

1

There are 1 answers

0
Wongjn On

'raw' and raw are equivalent when used as an object key in JavaScript, so it is fine that you use raw.

Object keys do not need be quoted in object initialization syntax if either:

  • The key has only numbers.
  • The key starts with a letter and only contains letters, numbers and underscores.

This is behavior of JavaScript syntax rather than Tailwind, hence why it was not mentioned in their documentation.