速记 CSS 属性列表

发布于 2024-09-13 09:50:12 字数 567 浏览 8 评论 0原文

我制作的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独夜无伴 2024-09-20 09:50:12

这是 Firefox 实现的所有简写属性的完整列表,从源代码中摘取。我不知道其中哪一个“可能会被你的 JavaScript 动画化”。我已经删除了那些只是速记的内容,因为内部原因太复杂,无法进入这里。

background
border
border-color
border-style
border-width
border-top
border-right
border-bottom
border-left
cue
font
list-style
margin
marker
-moz-border-start
-moz-border-end
-moz-border-radius
-moz-column-rule
-moz-outline-radius
-moz-transition
outline
overflow
padding
pause

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.

background
border
border-color
border-style
border-width
border-top
border-right
border-bottom
border-left
cue
font
list-style
margin
marker
-moz-border-start
-moz-border-end
-moz-border-radius
-moz-column-rule
-moz-outline-radius
-moz-transition
outline
overflow
padding
pause
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文