-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathcss-shapes.json
200 lines (200 loc) · 13.9 KB
/
css-shapes.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"spec": {
"title": "CSS Shapes Module Level 1",
"url": "https://drafts.csswg.org/css-shapes-1/"
},
"properties": [
{
"name": "shape-outside",
"href": "https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside",
"value": "none | [ <basic-shape> || <shape-box> ] | <image>",
"initial": "none",
"appliesTo": "floats and initial letter boxes",
"inherited": "no",
"percentages": "n/a",
"computedValue": "as defined for <basic-shape> (with <shape-box> following, if supplied); else the computed <image>; else the keyword as specified",
"canonicalOrder": "per grammar",
"animationType": "as defined for <basic-shape>, otherwise discrete",
"values": [
{
"name": "none",
"prose": "The float area is unaffected.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-outside-none",
"type": "value",
"value": "none"
},
{
"name": "<basic-shape>",
"prose": "The shape is computed based on one of the <basic-shape> functions. If a <shape-box> is also supplied, this defines the reference box for the <basic-shape> function. If <shape-box> is not supplied, then the reference box defaults to margin-box.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-outside-basic-shape",
"type": "value",
"value": "<basic-shape>"
},
{
"name": "<image>",
"prose": "The shape is extracted and computed based on the alpha channel of the specified <image> as defined by shape-image-threshold. User agents must use the CORS protocol defined by the [FETCH] specification for all URLs in a shape-outside value. When fetching, user agents must use \"Anonymous\" mode, set the referrer source to the stylesheet’s URL and set the origin to the URL of the containing document. If this results in network errors such that there is no valid fallback image, the effect is as if the value none had been specified.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-outside-image",
"type": "value",
"value": "<image>"
}
],
"styleDeclaration": [
"shape-outside",
"shapeOutside"
]
},
{
"name": "shape-image-threshold",
"href": "https://drafts.csswg.org/css-shapes-1/#propdef-shape-image-threshold",
"value": "<opacity-value>",
"initial": "0",
"appliesTo": "floats",
"inherited": "no",
"percentages": "n/a",
"computedValue": "specified number, clamped to the range [0,1]",
"canonicalOrder": "per grammar",
"animationType": "by computed value",
"values": [
{
"name": "<number>",
"prose": "Sets the threshold used for extracting a shape from an image. The shape is defined by the pixels whose alpha value is greater than the threshold. A threshold value outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-image-threshold-number",
"type": "value",
"value": "<number>"
}
],
"styleDeclaration": [
"shape-image-threshold",
"shapeImageThreshold"
]
},
{
"name": "shape-margin",
"href": "https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin",
"value": "<length-percentage [0,∞]>",
"initial": "0",
"appliesTo": "floats and initial letter boxes",
"inherited": "no",
"percentages": "refer to the inline size of the containing block",
"computedValue": "computed <length-percentage> value",
"canonicalOrder": "per grammar",
"animationType": "by computed value",
"values": [
{
"name": "<length-percentage [0,∞]>",
"prose": "Sets the margin of the shape to the specified value.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-margin-length-percentage-0",
"type": "value",
"value": "<length-percentage [0,∞]>"
}
],
"styleDeclaration": [
"shape-margin",
"shapeMargin"
]
}
],
"atrules": [],
"selectors": [],
"values": [
{
"name": "<basic-shape>",
"prose": "The <basic-shape> type can be specified using basic shape functions. When using this syntax to define shapes, the reference box is defined by each property that uses <basic-shape> values. The coordinate system for the shape has its origin on the top-left corner of the reference box with the x-axis running to the right and the y-axis running downwards. All the lengths expressed in percentages are resolved from the used dimensions of the reference box.",
"href": "https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape",
"type": "type",
"values": [
{
"name": "inset()",
"prose": "Defines an inset rectangle via insets from each edge of the reference box. If less than four <length-percentage> values are provided, the omitted values default in the same way as the margin shorthand: an omitted second or third value defaults to the first, and an omitted fourth value defaults to the second. The four <length-percentage>s define the position of the top, right, bottom, and left edges of a rectangle, respectively, as insets from the corresponding edges of the reference box. A pair of insets in either dimension that add up to more than the used dimension (such as left and right insets of 75% apiece) use the CSS Backgrounds 3 § 4.5 Overlapping Curves rules to proportionally reduce the inset effect to 100%. For example, specifying inset(75% 0 50% 0) has the top+bottom edges summing to 125% of the reference box’s height. They’re proportionally reduced to sum to 100%, identical to specifying inset(60% 0 40% 0). The optional <'border-radius'> argument(s) define rounded corners for the rectangle using the border-radius shorthand syntax.",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-inset",
"type": "function",
"value": "inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )"
},
{
"name": "xywh()",
"prose": "Defines a rectangle via offsets from the top and left edge of the reference box, and a specified width and height. The four <length-percentage>s define, respectively, the inset from the left edge of the reference box, the inset from the top edge of the reference box, the width of the rectangle, and the height of the rectangle. The optional <'border-radius'> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax.",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-xywh",
"type": "function",
"value": "xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [ round <'border-radius'> ]? )"
},
{
"name": "rect()",
"prose": "Defines a rectangle via insets from the top and left edges of the reference box. The four <length-percentage>s define the position of the top, right, bottom, and left edges of a rectangle, respectively, as insets from the top edge of the reference box (for the first and third values) or the left edge of the reference box (for the second and fourth values). An auto value makes the edge of the box coincide with the corresponding edge of the reference box: it’s equivalent to 0% as the first (top) or fourth (left) value, and equivalent to 100% as the second (right) or third (bottom) value. The second (right) and third (bottom) values are floored by the fourth (left) and second (top) values, respectively. For example, specifying rect(10px 0 0 20px) would place the bottom edge higher than the top edge, and the right edge further left than the left edge, so both are corrected to not cross over the other edge, identical to specifying rect(10px 20px 10px 20px). The optional <'border-radius'> argument(s) define rounded corners for the rectangle using the border-radius shorthand syntax.)",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-rect",
"type": "function",
"value": "rect( [ <length-percentage> | auto ]{4} [ round <'border-radius'> ]? )"
},
{
"name": "circle()",
"prose": "The <radial-size> argument defines the circle’s radius. Rather than referring to the gradient box, values are resolved against the reference box. Two <length-percentage> values are invalid. The <position> argument defines the center of the circle. Unless otherwise specified, this defaults to center if omitted.",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-circle",
"type": "function",
"value": "circle( <radial-size>? [ at <position> ]? )"
},
{
"name": "ellipse()",
"prose": "The <radial-size> argument defines the horizontal and vertical radiuses of the ellipse. Rather than referring to the gradient box, values are resolved against the reference box. The <position> argument defines the center of the ellipse. Unless otherwise specified, this defaults to center if omitted.",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-ellipse",
"type": "function",
"value": "ellipse( <radial-size>? [ at <position> ]? )"
},
{
"name": "polygon()",
"prose": "The <'fill-rule'> specifies the filling rule used to determine the interior. Defaults to nonzero if omitted. An optional <length> after a round keyword defines rounding for each vertex of the polygon. The length is the radius of a circle whose center lies on the bisector of the smaller angle of the vertex, and that is tangential to both sides of the vertex. Rounding polygon vertices that are both convex and concave. To avoid rounding more than half of any line segment, the rounding of each vertex must be clamped separately such that the radius is never more than the smaller of tan(angle/2) segment / 2 evaluated against both vertex line segments. This diagram shows the intent of the clamping formula. Each <length-percentage> pair specifies a vertex of the polygon, as a horizontal and vertical offset from the left and top edges of the reference box. The UA must close a polygon by connecting the last vertex with the first vertex of the list.",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-polygon",
"type": "function",
"value": "polygon( <'fill-rule'>? [ round <length> ]? , [<length-percentage> <length-percentage>]# )"
},
{
"name": "path()",
"prose": "The <'fill-rule'> specifies the filling rule used to determine the interior. Defaults to nonzero if omitted, unless the function is being used in a context such as SVG shapes where the fill-rule property is relevant. In that case an omitted value will use the computed value of the fill-rule property. The <string> represents an SVG Path data string. A path data string that does not conform to the to the grammar and parsing rules of SVG 1.1, or that does conform but defines an empty path, is invalid and causes the entire path() to be invalid. The initial position is defined by the first “move to” argument in the path string. For the initial direction follow SVG 1.1. The UA must close a path with an implicit closepath command (\"z\" or \"Z\") if it is not present in the string for properties that require a closed loop (such as shape-outside and clip-path).",
"href": "https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-path",
"type": "function",
"value": "path( <'fill-rule'>? , <string> )"
}
]
},
{
"name": "<basic-shape-rect>",
"href": "https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape-rect",
"type": "type",
"value": "<inset()> | <rect()> | <xywh()>"
},
{
"name": "<shape-box>",
"href": "https://drafts.csswg.org/css-shapes-1/#typedef-shape-box",
"type": "type",
"value": "<visual-box> | margin-box",
"values": [
{
"name": "margin-box",
"prose": "The margin-box value defines the shape enclosed by the outside margin edge. The corner radii of this shape are determined by the corresponding border-radius and margin values. If the ratio of border-radius/margin is 1 or more, or margin is negative or zero, then the margin box corner radius is max(border-radius + margin, 0). If the ratio of border-radius/margin is less than 1, and margin is positive, then the margin box corner radius is border-radius + margin * (1 + (ratio-1)^3).",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-box-margin-box",
"type": "value",
"value": "margin-box"
},
{
"name": "border-box",
"prose": "The border-box value defines the shape enclosed by the outside border edge. This shape follows all of the normal border radius shaping rules for the outside of the border.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-box-border-box",
"type": "value",
"value": "border-box"
},
{
"name": "padding-box",
"prose": "The padding-box value defines the shape enclosed by the outside padding edge. This shape follows all of the normal border radius shaping rules for the inside of the border.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-box-padding-box",
"type": "value",
"value": "padding-box"
},
{
"name": "content-box",
"prose": "The content-box value defines the shape enclosed by the outside content edge. Each corner radius of this box is the larger of 0 or border-radius - border-width - padding.",
"href": "https://drafts.csswg.org/css-shapes-1/#valdef-shape-box-content-box",
"type": "value",
"value": "content-box"
}
]
}
]
}