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
30 lines (27 loc) • 858 B
TypeScript
/**
* A stub that allows us to use the `css()` (css literal function) inside of *.yak files.
*
* This is mainly used for tooling like stylelint and typechecking inside css of *.yak files.
* It works similar to String.raw but filters out undefined, null and false values to allow for conditionals.
*
* @example
* ```tsx
* // inside of example.yak.ts
* import { mixin } from "next-yak/static";
*
* const styles = mixin.css`
* .foo {
* color: red;
* ${data.isBar && css`
* background: blue;
* `}
* }
* `
* ```
*/
declare const css: (strings: TemplateStringsArray, ...values: Array<string | number | boolean | null | undefined | Function>) => string;
declare const staticCssLiteral_css: typeof css;
declare namespace staticCssLiteral {
export { staticCssLiteral_css as css };
}
export { staticCssLiteral as mixin };