Skip to content

Instantly share code, notes, and snippets.

@nmn
Created November 30, 2023 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmn/d9f8e9e8576ae6a5740bb5e1bdd97cfd to your computer and use it in GitHub Desktop.
Save nmn/d9f8e9e8576ae6a5740bb5e1bdd97cfd to your computer and use it in GitHub Desktop.
Prettier Experimental Ternaries - Good Cases
const header =
useLayers ?
'\n@layer ' +
grouped.map((_, index) => `priority${index + 1}`).join(', ') +
';\n'
: '';
return useLayers ?
`@layer priority${index + 1}{\n${collectedCSS}\n}`
: collectedCSS;
const pos =
selector.includes('::') ?
selector.indexOf('::')
: selector.lastIndexOf('{');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment