From c4eb1dc2e6b56bdb9ac8ff3e775a5c5a556eb7a4 Mon Sep 17 00:00:00 2001 From: AndrewLeedham Date: Tue, 18 Jul 2023 14:23:41 +0100 Subject: [PATCH 1/3] Export AllQueries and other internal types --- .changeset/pretty-frogs-carry.md | 5 +++++ packages/css/src/types.ts | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/pretty-frogs-carry.md diff --git a/.changeset/pretty-frogs-carry.md b/.changeset/pretty-frogs-carry.md new file mode 100644 index 000000000..fde6be5d7 --- /dev/null +++ b/.changeset/pretty-frogs-carry.md @@ -0,0 +1,5 @@ +--- +'@vanilla-extract/css': patch +--- + +Export AllQueries and other internal types diff --git a/packages/css/src/types.ts b/packages/css/src/types.ts index 7d89d3ced..ab20b5455 100644 --- a/packages/css/src/types.ts +++ b/packages/css/src/types.ts @@ -6,13 +6,13 @@ import type { SimplePseudos } from './simplePseudos'; // csstype is yet to ship container property types as they are not in // the output MDN spec files yet. Remove this once that's done. // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries -interface ContainerProperties { +export interface ContainerProperties { container?: string; containerType?: 'size' | 'inline-size' | (string & {}); containerName?: string; } -type CSSTypeProperties = Properties & +export type CSSTypeProperties = Properties & ContainerProperties; export type CSSProperties = { @@ -32,13 +32,13 @@ export type CSSPropertiesWithVars = CSSProperties & { }; }; -type PseudoProperties = { +export type PseudoProperties = { [key in SimplePseudos]?: CSSPropertiesWithVars; }; -type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; +export type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; -type Query = { +export type Query = { [key in Key]?: { [query: string]: Omit; }; @@ -49,7 +49,7 @@ export type FeatureQueries = Query<'@supports', StyleType>; export type ContainerQueries = Query<'@container', StyleType>; export type Layers = Query<'@layer', StyleType>; -interface AllQueries +export interface AllQueries extends MediaQueries>, FeatureQueries>, ContainerQueries>, @@ -57,7 +57,7 @@ interface AllQueries export type WithQueries = StyleType & AllQueries; -interface SelectorMap { +export interface SelectorMap { [selector: string]: CSSPropertiesWithVars & WithQueries; } @@ -120,7 +120,7 @@ export interface Composition { classList: string; } -type IdentOption = 'short' | 'debug'; +export type IdentOption = 'short' | 'debug'; export interface Adapter { appendCss: (css: CSS, fileScope: FileScope) => void; registerClassName: (className: string, fileScope: FileScope) => void; From c303a0bd630bdd81b0235fea9791c51805134ebc Mon Sep 17 00:00:00 2001 From: AndrewLeedham Date: Thu, 3 Aug 2023 17:11:38 +0100 Subject: [PATCH 2/3] Just export AllQueries --- packages/css/src/types.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/css/src/types.ts b/packages/css/src/types.ts index ab20b5455..b3eeedb22 100644 --- a/packages/css/src/types.ts +++ b/packages/css/src/types.ts @@ -6,13 +6,13 @@ import type { SimplePseudos } from './simplePseudos'; // csstype is yet to ship container property types as they are not in // the output MDN spec files yet. Remove this once that's done. // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries -export interface ContainerProperties { +interface ContainerProperties { container?: string; containerType?: 'size' | 'inline-size' | (string & {}); containerName?: string; } -export type CSSTypeProperties = Properties & +type CSSTypeProperties = Properties & ContainerProperties; export type CSSProperties = { @@ -32,13 +32,13 @@ export type CSSPropertiesWithVars = CSSProperties & { }; }; -export type PseudoProperties = { +type PseudoProperties = { [key in SimplePseudos]?: CSSPropertiesWithVars; }; -export type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; +type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; -export type Query = { +type Query = { [key in Key]?: { [query: string]: Omit; }; @@ -57,7 +57,7 @@ export interface AllQueries export type WithQueries = StyleType & AllQueries; -export interface SelectorMap { +interface SelectorMap { [selector: string]: CSSPropertiesWithVars & WithQueries; } @@ -120,7 +120,7 @@ export interface Composition { classList: string; } -export type IdentOption = 'short' | 'debug'; +type IdentOption = 'short' | 'debug'; export interface Adapter { appendCss: (css: CSS, fileScope: FileScope) => void; registerClassName: (className: string, fileScope: FileScope) => void; @@ -146,4 +146,4 @@ export type ThemeVars = MapLeafNodes< export type ClassNames = string | Array; -export type ComplexStyleRule = StyleRule | Array; +export type ComplexStyleRule = StyleRule | Array; \ No newline at end of file From a69189baf32d5a70928224a72b7b4f9b9c557d75 Mon Sep 17 00:00:00 2001 From: AndrewLeedham Date: Mon, 7 Aug 2023 17:21:15 +0100 Subject: [PATCH 3/3] Run prettier --- packages/css/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/css/src/types.ts b/packages/css/src/types.ts index b3eeedb22..8820378fb 100644 --- a/packages/css/src/types.ts +++ b/packages/css/src/types.ts @@ -146,4 +146,4 @@ export type ThemeVars = MapLeafNodes< export type ClassNames = string | Array; -export type ComplexStyleRule = StyleRule | Array; \ No newline at end of file +export type ComplexStyleRule = StyleRule | Array;