Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-lizards-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/css': minor
---

Add `anchor positioning` rules types
28 changes: 26 additions & 2 deletions packages/css/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CSSVarFunction, MapLeafNodes } from '@vanilla-extract/private';
import type { AtRule, Properties } from 'csstype';
import type { AtRule, Globals, Properties } from 'csstype';

import type { SimplePseudos } from './simplePseudos';

Expand All @@ -16,8 +16,32 @@ interface ContainerProperties {
containerName?: string;
}

interface AnchorProperties {
anchorName?: 'none' | `--${string}` | Globals | (string & {});
positionAnchor?: 'auto' | `--${string}` | Globals;
positionArea?:
| 'none'
| 'all'
| 'bottom'
| 'center'
| 'end'
| 'left'
| 'right'
| 'self-end'
| 'self-start'
| 'start'
| 'top'
| 'x-end'
| 'x-start'
| 'y-end'
| 'y-start'
| Globals
| (string & {});
}

type CSSTypeProperties = Properties<number | (string & {})> &
ContainerProperties;
ContainerProperties &
AnchorProperties;

export type CSSProperties = {
[Property in keyof CSSTypeProperties]:
Expand Down