Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huruji/yoga-layout-style-adaptor
just adapt yoga-layout with css style, so we can use yoga-layout with no pain
https://github.com/huruji/yoga-layout-style-adaptor
Last synced: about 2 months ago
JSON representation
just adapt yoga-layout with css style, so we can use yoga-layout with no pain
- Host: GitHub
- URL: https://github.com/huruji/yoga-layout-style-adaptor
- Owner: huruji
- Created: 2020-08-14T17:58:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T09:39:21.000Z (over 4 years ago)
- Last Synced: 2024-11-11T11:45:09.510Z (2 months ago)
- Language: TypeScript
- Size: 124 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-github-star - yoga-layout-style-adaptor - layout with css style, so we can use yoga-layout with no pain | huruji | 3 | (TypeScript)
README
# yoga-layout-style-adaptor
just adapt yoga-layout with css style, so we can use yoga-layout with no pain
## why
yoga-layout 只暴漏了类似 setHeight、setFlex 这类方法,而且对于各种样式还需要自己适配,那么这就是你想要的这个适配器,通过一个 setStyle 方法就可以实现。
## how to use
```bash
npm i yoga-layout-style-adaptor -S
``````js
import { setStyle } from 'yoga-layout-style-adaptor'setStyle(yogaNode, cssStyle)
```就是这么简单就可以将 css 样式应用到 yoga 节点中
同时也 export 了对应的样式接口
```js
import type { CSSProperties } from 'yoga-layout-style-adaptor'
```