写了个静态提取 css 的 css-in-jss 的库,能不能给点个 star https://github.com/colliejs/colliejs

144 天前
 colliedog
网址: https://github.com/colliejs/colliejs
757 次点击
所在节点    分享创造
3 条回复
colliedog
144 天前
import { absYCenter } from "@collie-ui/css";
import { makeStyled } from "@colliejs/react";
import { collieConfig } from "../collie.config";
export const styled = makeStyled(collieConfig);

export const StyledButton = styled("button", {
w: 100,
h: 40,
_hover: {
opacity: 0.8,
background: "$primary",
borderRadius: 10,
color: "white",
},
_after: {
h: "100%",
w: [10, 4],
background: "red",
...absYCenter({ right: 0 }),
},

variants: {
size: {
full: {
w: "100%",
},
big: {
w: 80,
},
md: {
w: 40,
},
sm: {
w: 20,
},
dynamic: x => ({
//any size you want
w: x,
}),
},
shape: {
round: {
borderRadius: 9999,
},
rect: {
borderRadius: 0,
},
},
status: {
disabled: {
true: {
cursor: "not-allowed",
background: "$gray200",
},
},
},
},

compoundVariants: [
{
size: "big",
shape: "round",
css: {
background: "$gray200",
},
},
],
defaultVariants: {
shape: "rect",
},
});
privateproxies
142 天前
支持一下
colliedog
142 天前
@privateproxies 感谢大佬

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1005239

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX