From d9bb94a557be020ea94a9a7a38dda2421c07bc85 Mon Sep 17 00:00:00 2001 From: markdalgleish Date: Sat, 10 Jun 2023 10:06:19 +1000 Subject: [PATCH] fix formatting --- examples/next/components/HelloWorld.css.ts | 13 +++-- packages/css/src/transformCss.ts | 4 +- packages/css/src/types.ts | 38 ++++++------ packages/css/src/vars.ts | 67 ++++++++++++++++------ 4 files changed, 80 insertions(+), 42 deletions(-) diff --git a/examples/next/components/HelloWorld.css.ts b/examples/next/components/HelloWorld.css.ts index 6fcc13e57..fd887d309 100644 --- a/examples/next/components/HelloWorld.css.ts +++ b/examples/next/components/HelloWorld.css.ts @@ -1,4 +1,10 @@ -import { style, createVar, keyframes, getVarName, fallbackVar } from '@vanilla-extract/css'; +import { + style, + createVar, + keyframes, + getVarName, + fallbackVar, +} from '@vanilla-extract/css'; const color = createVar(); const angle = createVar({ @@ -21,14 +27,13 @@ export const root = style({ backgroundImage: `linear-gradient(${angle}, rgba(153, 70, 198, 0.35) 0%, rgba(28, 56, 240, 0.46) 100%)`, animation: `${angleKeyframes} 7s infinite ease-in-out both`, - ':hover': { opacity: 0.8, color: color, }, - + vars: { [color]: '#fef', [angle]: fallbackVar(angle, '138deg'), - } + }, }); diff --git a/packages/css/src/transformCss.ts b/packages/css/src/transformCss.ts index cedd45cd3..834588c68 100644 --- a/packages/css/src/transformCss.ts +++ b/packages/css/src/transformCss.ts @@ -155,11 +155,11 @@ class Stylesheet { } if (root.type === 'property') { - this.propertyRules.push(root) + this.propertyRules.push(root); return; } - + if (root.type === 'keyframes') { root.rule = Object.fromEntries( Object.entries(root.rule).map(([keyframe, rule]) => { diff --git a/packages/css/src/types.ts b/packages/css/src/types.ts index ea1d42b6a..4819c894d 100644 --- a/packages/css/src/types.ts +++ b/packages/css/src/types.ts @@ -106,7 +106,7 @@ export type CSSLayerDeclaration = { export type CSSPropertyBlock = { type: 'property'; name: string; - rule: AtRule.Property + rule: AtRule.Property; }; export type CSS = @@ -155,21 +155,21 @@ export type ClassNames = string | Array; export type ComplexStyleRule = StyleRule | Array; -export type PropertySyntax = - | '' - | '' - | '' - | '' - | '' - | '' - | '' - | '' - | '' - | '