@ cssints/ 渐变
减轻梯度 点缀: 沿着平缓曲线从一色到一色的梯度,扩展为
颜色在构建时会停止,所以在二站式梯度显示一站时,淡出没有硬边. 它是一个价值成员
cssints/plugin scope() 返回一个 <image>,所以它去一个图像去的地方(backgroundImage, (中文(简体) ), maskImage, (中文(简体) ),
borderImageSource) (中文(简体) ). 没有运行时间.
import { backgroundImage, createTokens } from "cssints" with { type: "cssints" };
import { gradient } from "@cssints/gradient" with { type: "cssints" };
const t = createTokens({ color: { $type: "color", ink: { $value: "#111111" } } });
// gradient(kind, direction, from, to, easing?, stops?)
export const fade = backgroundImage(
gradient("linear", "to bottom", "#000", "transparent", "ease-in-out", 5),
);
export const glow = backgroundImage(
gradient("radial", "circle at top", "red", "blue", "cubic-bezier(0.5, 0, 0.5, 1)", 4),
);
export const ink = backgroundImage(
gradient("linear", "to right", t.color.ink, "white", "ease-in", 4),
);
._4we9ve {
background-image: linear-gradient(
to bottom,
#000,
#000000d7 27.44%,
#00000080 50%,
#00000028 72.56%,
transparent
);
}
._ba8wye {
background-image: radial-gradient(circle at top, red, #c44a6f 37.04%, #5348d0 62.96%, blue);
}
._1l9gl59 {
background-image: linear-gradient(
to right,
var(--color-ink),
color-mix(in oklab, var(--color-ink), white 25.93%) 44.59%,
color-mix(in oklab, var(--color-ink), white 74.07%) 83.41%,
white
);
}
规则
- 参数,每个字符串 :
kind实值linear, (中文(简体) ),radial或者说conic· ;direction这是第一个 参数,要求("to bottom", (中文(简体) ),"45deg", (中文(简体) ),"circle at top", (中文(简体) ),"at center", (中文(简体) ),"from 90deg"(三);from财务报告和审定财务报表to为: 颜色或颜色符号;easing实值linear, (中文(简体) ),ease, (中文(简体) ),ease-in, (中文(简体) ),ease-out, (中文(简体) ),ease-in-out(默认)或cubic-bezier(x1, y1, x2, y2)· ;stops是 2 到 64 (13 默认)。 检查它们的类型 并在建筑中再次检查 时间,与一个语法相反. - 停止 设置为后cs- easing- 梯度值
t样本均匀,x(t)这是 停止位置和y(t)份额to在它里面。 内。 过度射入的曲线( A)y在0到1外 夹住两个 颜色. - 颜色 和多倍相混合的α, 因为CSS混合它们,所以
transparent淡出另一种颜色的花色 并且不要灰化它。 端点以书面打印;中间的站点为 sRGB hex(#rrggbbaa当不是时 (原始内容存档于2012-10-12). Official website. 位置和股票最多有2个小数,因此每个积分的输出都是一样的. - 脚趾和
currentColor。 。 。 . 信使来了var(--name)财务报告和审定财务报表currentColor元素的: 无法读取 建立时间。 当一个终点不能是,每站都是color-mix(in oklab, from, to N%)担任同样职位的 浏览器混合它们.color-mix()需要Chrome 111, Safari 16.2, Firefox 113: 对于老目标,建筑警告,因为它 用于任何值. - 错误在调用时:语法以外的部分(
gradient: unexpected "steps(4" in "linear to bottom red blue steps(4)", expected linear | <cubic-bezier-easing-function> | <integer> | end of value),按错误顺序的参数 (单位:千美元)cssints: gradient(): "blue" is not an easing (the arguments are kind, direction, from, to, easing?, stops?)页:1 图像不走时的梯度(css.color(gradient(…)),在类型和构建时间出现错误.
限制
- 将两个字形颜色之间的一站被夹到 sRGB:一个宽加穆特端点(
color(display-p3 …)一个生动的oklch()(中文(简体) ) 将自己的值保留在结尾,但相间的颜色是最近的 sRGB 。 给它作为纪念 保持游戏: 车站就是了color-mix()。 。 。 . steps()财务报告和审定财务报表linear()没有放松,也没有放松的标志(没有放松的标志类型),也没有数字标志 页:1stops页:1repeating-*梯度、两种以上颜色和一种颜色插入方法(in oklch(没有) 也一样.- 这些部分与语法的空格相接(参见API参考文献中的"功能"),所以
"to", "bottom"作为两个 参数通过语法,只被参数检查所捕获;将方向写成一个字符串.
cd packages/gradient && bun run test # the stop math, fixtures through the engine (output, errors)
cd packages/gradient && bun run typecheck # and the type test, test/types/gradient.ts
贷项
停止跟着 升学率 财务报告和审定财务报表 放松坐标 (麻省理工学院,安德烈亚斯·拉森):缓冲曲线取样 进入颜色站。 代码在此被写入; 没有复制代码 。 颜色被混合 库罗里语name (麻省理工学院,丹·伯佐),一个附属公司.