属性
Deft只支持部分CSS属性和属性值,以下为支持的属性和值类型。
文字
| 属性 | 属性类型 |
|---|---|
| color | <color> |
| font-size | <length> |
| font-family | <string> |
| font-weight | thin | extra-light | light | normal | medium | semi-bold | bold | extra-bold | black | extra-black | <number> |
| font-style | normal | italic |
| line-height | <length> | <percent> | <number> |
背景
| 属性 | 属性类型 |
|---|---|
| background-color | <color> |
边框
| 属性 | 属性类型 |
|---|---|
| border-top-width | <length> | <percent> |
| border-right-width | <length> | <percent> |
| border-bottom-width | <length> | <percent> |
| border-left-width | <length> | <percent> |
| border-top-color | <color> |
| border-right-color | <color> |
| border-bottom-color | <color> |
| border-left-color | <color> |
| border-top-left-radius | <length> |
| border-top-right-radius | <length> |
| border-bottom-right-radius | <length> |
| border-bottom-left-radius | <length> |
| border-top | <length> <color> |
| border-right | <length> <color> |
| border-bottom | <length> <color> |
| border-left | <length> <color> |
| border | <length> <color> |
布局
| 属性 | 属性类型 |
|---|---|
| display | none| flex |
| position | static | relative | absolute |
| flex | number |
| flex-basis | <length> | <percent> |
| flex-grow | number |
| flex-shrink | number |
| align-self | auto | flex-start | center | flex-end | stretch | baseline | space-between | space-around | space-evenly |
| direction | ltr | rtl |
| justify-content | flex-start | center | flex-end | space-between | space-around | space-evenly |
| flex-direction | column | row | column-reverse | row-reverse |
| align-content | auto | flex-start | center | flex-end | stretch | baseline | space-between | space-around | space-evenly |
| align-items | auto | flex-start | center | flex-end | stretch | baseline | space-between | space-around | space-evenly |
| flex-wrap | no-wrap | wrap | wrap-reverse |
| column-gap | <length> |
| row-gap | <length> |
| top | <length> | <percent> |
| right | <length> | <percent> |
| bottom | <length> | <percent> |
| left | <length> | <percent> |
尺寸
| 属性 | 属性类型 |
|---|---|
| width | <length> | <percent> |
| height | <length> | <percent> |
| max-width | <length> | <percent> |
| max-height | <length> | <percent> |
| min-width | <length> | <percent> |
| min-height | <length> | <percent> |
边距
| 属性 | 属性类型 |
|---|---|
| margin-top | <length> | <percent> |
| margin-right | <length> | <percent> |
| margin-bottom | <length> | <percent> |
| margin-left | <length> | <percent> |
| margin | <length> | <percent> |
| padding-top | <length> | <percent> |
| padding-right | <length> | <percent> |
| padding-bottom | <length> | <percent> |
| padding-left | <length> | <percent> |
| padding | <length> | <percent> |
变换
| 属性 | 属性类型 |
|---|---|
| transform | <transform> |
动画
| 属性 | 属性类型 |
|---|---|
| animation-name | <string> |
| animation-duration | number |
| animation-iteration-count | number |