速记 CSS 属性列表
我制作的 JavaScript 函数需要解析所有不一定附加“一个”值的 CSS 值。例如, margin:0 0 4px 12px;
实际上是四个值(margin-top、margin-right 等)。
基本上,我需要的只是一个速记属性列表。但是,我不需要所有速记 css。我只需要可能被动画化的速记 css(rgb、px、em 等)。所以,我不关心 border:1px Solid black;
因为我无法为 solid 制作动画。
但我确实关心 border-width,
code> 因为 border-width 是所有四个边框的简写。
无论如何,我的清单包括:
- 边框宽度
- 背景位置
- 填充
- 边距
- 边界半径 - 盒子阴影
- 轮廓半径
- 边框颜色
- 边框颜色 - 文本阴影 - 字体
那么,我错过了什么吗?你看,我不知道是否有任何晦涩的属性,例如:mystery-color:red green blue hazel pigbreath;
A JavaScript function I made needs to parse all CSS values that don't necessarily have 'one' value attached to them. For example, margin:0 0 4px 12px;
is actually four values (margin-top, margin-right, etc).
Basically, all I need is a list of the shorthand properties. However, I don't need all shorthand css. I just need the shorthand css that could potentially be animated (rgb, px, em,etc). So, I don't care about border:1px solid black;
since I can't animate solid.
But I do care about border-width,
since border-width is shorthand for all four borders.
Anyways, my list includes:
- border-width
- background-position
- padding
- margin
- border-radius
- box-shadow
- outline-radius
- border-color
- border-colors
- text-shadow
- font
So, did I miss any? You see, I don't know if there are any obscure properties that are like: mystery-color:red green blue hazel pigbreath;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Firefox 实现的所有简写属性的完整列表,从源代码中摘取。我不知道其中哪一个“可能会被你的 JavaScript 动画化”。我已经删除了那些只是速记的内容,因为内部原因太复杂,无法进入这里。
This is a complete list of all shorthand properties implemented by Firefox, ripped from the source code. I don't know which of them "could potentially be animated" by your JavaScript. I've trimmed out the ones that are only shorthand for internal reasons too complicated to get into here.