Skip to content

Commit 5dd65a3

Browse files
committed
Add support for CSS anchor positioning rules types
1 parent 383bf1e commit 5dd65a3

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.changeset/chilled-lizards-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/css': minor
3+
---
4+
5+
Add `anchor positioning` rules types

packages/css/src/types.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CSSVarFunction, MapLeafNodes } from '@vanilla-extract/private';
2-
import type { AtRule, Properties } from 'csstype';
2+
import type { AtRule, Globals, Properties } from 'csstype';
33

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

@@ -16,8 +16,32 @@ interface ContainerProperties {
1616
containerName?: string;
1717
}
1818

19+
interface AnchorProperties {
20+
anchorName?: 'none' | `--${string}` | Globals | (string & {});
21+
positionAnchor?: 'auto' | `--${string}` | Globals;
22+
positionArea?:
23+
| 'none'
24+
| 'all'
25+
| 'bottom'
26+
| 'center'
27+
| 'end'
28+
| 'left'
29+
| 'right'
30+
| 'self-end'
31+
| 'self-start'
32+
| 'start'
33+
| 'top'
34+
| 'x-end'
35+
| 'x-start'
36+
| 'y-end'
37+
| 'y-start'
38+
| Globals
39+
| (string & {});
40+
}
41+
1942
type CSSTypeProperties = Properties<number | (string & {})> &
20-
ContainerProperties;
43+
ContainerProperties &
44+
AnchorProperties;
2145

2246
export type CSSProperties = {
2347
[Property in keyof CSSTypeProperties]:

0 commit comments

Comments
 (0)