lukejacksonn / oceanwind

Compiles tailwind shorthand into css at runtime. Succeeded by Twind.
https://twind.dev
264 stars 12 forks source link

Makes theme extendable #2

Closed lukejacksonn closed 3 years ago

lukejacksonn commented 3 years ago

Provide a themed export that primes the process function with the default theme deep merged with any provided custom theme. For example:

import { themed } from 'https://unpkg.com/oceanwind';

const ow = themed({
  colors: {
    red: {
      500: 'hotpink',
    },
  },
});

ow`bg-red-500`; // will result in a hotpink background-color

Also makes the process function pure(er) by detaching it from the call to otion. This makes testing a bit easier.