UNPKG

next-yak

Version:

next-yak is a CSS-in-JS solution tailored for Next.js that seamlessly combines the expressive power of styled-components syntax with efficient build-time extraction of CSS using Next.js's built-in CSS configuration

15 lines (12 loc) 491 B
"use client"; import React, { createContext, use } from "react"; //#region runtime/context/index.tsx const YakContext = createContext({}); const useTheme = () => { const context = use(YakContext); return context instanceof Promise ? use(context) : context; }; const YakThemeProvider = ({ children, theme = {} }) => /* @__PURE__ */ React.createElement(YakContext.Provider, { value: theme }, children); //#endregion export { YakThemeProvider, useTheme }; //# sourceMappingURL=index.js.map