Color

This composable provides an easy way to define stateful colors. It is used internally to handle many components like t-button.


Usage

There are many variations of passages!
import { TCell } from "@dija/tohama-components";
import { useColor } from "@dija/tohama-use";
import { defineComponent } from "vue";

export default defineComponent({
  setup() {
    const colors = useColor({
      state: {
        text: {
          color: "alert",
          template: "text",
        },
        background: {
          color: "alert",
          template: "flat",
        },
        border: {
          color: "alert",
          template: "border",
        },
      },
      hover: true,
    });

    return () => (
      <TCell class={["border-2", colors.value]} p>
        There are many variations of passages!
      </TCell>
    );
  },
});