https://github.com/saber2pr/styled
inline css/less.
https://github.com/saber2pr/styled
css-in-js css-in-react
Last synced: 8 months ago
JSON representation
inline css/less.
- Host: GitHub
- URL: https://github.com/saber2pr/styled
- Owner: Saber2pr
- Created: 2021-01-30T02:32:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-30T07:42:33.000Z (about 5 years ago)
- Last Synced: 2025-07-09T10:39:45.443Z (9 months ago)
- Topics: css-in-js, css-in-react
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @saber2pr/styled
> 内联css支持
vscode安装插件 vscode-styled-components
```bash
yarn add @saber2pr/styled
```
### start
```tsx
import styled from '@saber2pr/styled'
// css或less字符串片段
const utilcssText = styled._`
.cursor-pointer {
cursor: pointer;
}
.flex {
display: flex;
}
`
// css样式元素
const utilcssStyle = styled.css`
.cursor-pointer {
cursor: pointer;
}
.flex {
display: flex;
}
`
// less样式元素
const utillessStyle = styled.less`
.flex {
display: flex;
.cursor-pointer {
cursor: pointer;
}
}
`
// 插入css片段
const inlineStyle = styled.less`
${utilcssText}
`
// 内联样式
const Component = () => {
return
{inlineStyle}
{utillessStyle}
}
```