Skip to content

Instantly share code, notes, and snippets.

@xandout
Created September 17, 2020 23:41
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 xandout/b1991394b06669ce92257913a3c8cc7a to your computer and use it in GitHub Desktop.
Save xandout/b1991394b06669ce92257913a3c8cc7a to your computer and use it in GitHub Desktop.
Tailwind CSS v1.0 Color Palette
<div id="app"></div>
const colors =['gray','red','orange','yellow','green','teal','blue','indigo','purple','pink']
const ColorRow = function ({color}) {
return (
<div class="flex flex-wrap">
{
[100, 200, 300, 400, 500, 600, 700, 800, 900].reverse().map(shade => (
<div class={`h-12 w-12 bg-${color}-${shade}`}></div>
))
}
</div>
)
}
ReactDOM.render(
<div class="min-h-screen bg-white p-8 flex items-center justify-center">
<div>
{ colors.map(color => <ColorRow color={color}/>) }
</div>
</div>,
document.getElementById('app')
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.4/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.4/umd/react-dom.production.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.8.10/tailwind.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment