-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc147d3
commit 1195171
Showing
16 changed files
with
260 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import type { CompositionStyleObject } from "./css.types" | ||
|
||
interface Token<T> { | ||
value: T | ||
description?: string | ||
} | ||
|
||
interface Recursive<T> { | ||
[key: string]: Recursive<T> | T | ||
} | ||
|
||
/* ----------------------------------------------------------------------------- | ||
* Text styles | ||
* -----------------------------------------------------------------------------*/ | ||
|
||
type TextStyleProperty = | ||
| "fontSize" | ||
| "fontSizeAdjust" | ||
| "fontVariationSettings" | ||
| "fontVariantPosition" | ||
| "fontVariantCaps" | ||
| "fontVariantNumeric" | ||
| "fontVariantAlternates" | ||
| "fontVariantLigatures" | ||
| "fontFamily" | ||
| "fontWeight" | ||
| "fontSynthesis" | ||
| "fontStyle" | ||
| "fontVariant" | ||
| "lineHeight" | ||
| "letterSpacing" | ||
| "textDecoration" | ||
| "textTransform" | ||
| "textIndent" | ||
| "textDecorationColor" | ||
| "textDecorationLine" | ||
| "textDecorationStyle" | ||
| "textEmphasisColor" | ||
| "textEmphasisPosition" | ||
| "textEmphasisStyle" | ||
| "hyphenateCharacter" | ||
| "textOrientation" | ||
| "textOverflow" | ||
| "textRendering" | ||
|
||
export type TextStyle = CompositionStyleObject<TextStyleProperty> | ||
|
||
export type TextStyles = Recursive<Token<TextStyle>> | ||
|
||
/* ----------------------------------------------------------------------------- | ||
* Layer styles | ||
* -----------------------------------------------------------------------------*/ | ||
|
||
type Placement = | ||
| "Top" | ||
| "Right" | ||
| "Bottom" | ||
| "Left" | ||
| "Inline" | ||
| "Block" | ||
| "InlineStart" | ||
| "InlineEnd" | ||
| "BlockStart" | ||
| "BlockEnd" | ||
|
||
type Radius = | ||
| `Top${"Right" | "Left"}` | ||
| `Bottom${"Right" | "Left"}` | ||
| `Start${"Start" | "End"}` | ||
| `End${"Start" | "End"}` | ||
|
||
type LayerStyleProperty = | ||
| "background" | ||
| "backgroundColor" | ||
| "backgroundImage" | ||
| "borderRadius" | ||
| "border" | ||
| "borderWidth" | ||
| "borderColor" | ||
| "borderStyle" | ||
| "boxShadow" | ||
| "filter" | ||
| "backdropFilter" | ||
| "transform" | ||
| "color" | ||
| "opacity" | ||
| "backgroundBlendMode" | ||
| "backgroundAttachment" | ||
| "backgroundClip" | ||
| "backgroundOrigin" | ||
| "backgroundPosition" | ||
| "backgroundRepeat" | ||
| "backgroundSize" | ||
| `border${Placement}` | ||
| `border${Placement}Width` | ||
| "borderRadius" | ||
| `border${Radius}Radius` | ||
| `border${Placement}Color` | ||
| `border${Placement}Style` | ||
| "padding" | ||
| `padding${Placement}` | ||
|
||
export type LayerStyle = CompositionStyleObject<LayerStyleProperty> | ||
|
||
export type LayerStyles = Recursive<Token<LayerStyle>> | ||
|
||
export interface CompositionStyles { | ||
textStyles: TextStyles | ||
layerStyles: LayerStyles | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.