Skip to content

Commit

Permalink
fix: provide theme resolver negative stub implementation for tailwi…
Browse files Browse the repository at this point in the history
…nd compat
  • Loading branch information
sastan committed Dec 9, 2020
1 parent 7bc9e6f commit a62054d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/internal/theme.ts
Expand Up @@ -44,6 +44,8 @@ const resolveContext: ThemeSectionResolverContext = {
// },
// { ...source },
// ),
// Stub implementation as negated values are automatically infered and do _not_ not to be in the theme
negative: () => ({}),

breakpoints: (source) =>
// eslint-disable-next-line unicorn/no-reduce
Expand Down
7 changes: 7 additions & 0 deletions packages/types/src/theme.ts
Expand Up @@ -19,6 +19,13 @@ export type Unwrap<T> = T extends string[] ? string : T extends Record<string, i
export type ThemeSectionType<T> = T extends ThemeSection<infer R> ? Unwrap<R> : never

export interface ThemeSectionResolverContext {
/**
* No-op function as negated values are automatically infered and do _not_ not to be in the theme.
*/
readonly negative: (
records: Record<string, string | undefined>,
) => Record<string, string | undefined>

readonly breakpoints: (
records: Record<string, string | undefined>,
) => Record<string, string | undefined>
Expand Down

0 comments on commit a62054d

Please sign in to comment.