|
54 | 54 | </p> |
55 | 55 | <h1 class="p-name no-ref" id=title>CSS Extensions</h1> |
56 | 56 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
57 | | - <span class=dt-updated><span class=value-title title=20140411>11 April 2014</span></span></span></h2> |
| 57 | + <span class=dt-updated><span class=value-title title=20140412>12 April 2014</span></span></span></h2> |
58 | 58 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-extensions>http://dev.w3.org/csswg/css-extensions</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-extensions>http://dev.w3.org/csswg/css-extensions</a> |
59 | 59 | <dt>Feedback:</dt> |
60 | 60 | <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-extensions%5D%20feedback">www-style@w3.org</a> |
@@ -112,9 +112,10 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class |
112 | 112 | <ul class=toc> |
113 | 113 | <li><a href=#script-custom-selectors><span class=secno>3.1</span> Script-based Custom Selectors</a> |
114 | 114 | <li><a href=#custom-selectors-cssom><span class=secno>3.2</span> CSSOM</a></ul> |
115 | | - <li><a href=#custom-functions><span class=secno>4</span> Custom Functions</a> |
116 | | - <li><a href=#custom-combinators><span class=secno>5</span> Custom Selector Combinators</a> |
117 | | - <li><a href=#custom-atrules><span class=secno>6</span> Custom At-Rules</a> |
| 115 | + <li><a href=#custom-property><span class=secno>4</span> Custom Properties</a> |
| 116 | + <li><a href=#custom-functions><span class=secno>5</span> Custom Functions</a> |
| 117 | + <li><a href=#custom-combinators><span class=secno>6</span> Custom Selector Combinators</a> |
| 118 | + <li><a href=#custom-atrules><span class=secno>7</span> Custom At-Rules</a> |
118 | 119 | <li><a href=#conformance><span class=secno></span> Conformance</a> |
119 | 120 | <ul class=toc> |
120 | 121 | <li><a href=#conventions><span class=secno></span> Document conventions</a> |
@@ -225,10 +226,52 @@ <h3 class="heading settled heading" data-level=3.2 id=custom-selectors-cssom><sp |
225 | 226 | <p class=issue id=issue-cb6e966f><a class=self-link href=#issue-cb6e966f></a> |
226 | 227 | Fill in. |
227 | 228 |
|
228 | | -<h2 class="heading settled heading" data-level=4 id=custom-functions><span class=secno>4 </span><span class=content> |
| 229 | +<h2 class="heading settled heading" data-level=4 id=custom-property><span class=secno>4 </span><span class=content> |
| 230 | +Custom Properties</span><a class=self-link href=#custom-property></a></h2> |
| 231 | + |
| 232 | + <div class=issue id=issue-234df7b0><a class=self-link href=#issue-234df7b0></a> |
| 233 | + Need to more fully support Custom Properties |
| 234 | + (and eventually remove them from the variable spec entirely, since they’ll be defined here). |
| 235 | + |
| 236 | +<p> By default, custom properties are optimized for use as <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-variables-1/#funcdef-var title=var()>var()</a> values—<wbr>they inherit, |
| 237 | + have an empty initial value, |
| 238 | + don’t do any syntax checking, |
| 239 | + and don’t animate. |
| 240 | + All of these should be adjustable somehow. |
| 241 | + |
| 242 | + <pre>@custom-property --foo { |
| 243 | + scope: [ inherit | local ]; |
| 244 | + initial: <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-variables-1/#typedef-any-value title="<any-value>"><any-value></a>*; |
| 245 | + value: <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>"><length></a> <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>"><length></a> <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-color-3/#valuea-def-color title="<color>"><color></a>; |
| 246 | + /* Literally, define a simplistic definition syntax. |
| 247 | + OR FULL CSS PROPERTY GRAMMAR?!? */ |
| 248 | +} |
| 249 | +</pre> |
| 250 | +<p> If you provide a "value" field with animatable types, |
| 251 | + we can animate in the most direct fashion automatically. |
| 252 | + We could also let you hook into that: |
| 253 | + you register a callback, |
| 254 | + and whenever a property starts animating, |
| 255 | + we call it with the starting and ending values. |
| 256 | + You have to return a function which takes a progress value (between 0 and 1) |
| 257 | + and returns a value for your property; |
| 258 | + we’ll call it as we animate the value. |
| 259 | + (How can we hook into Web Anim here? Can you just return an Animation object?) |
| 260 | + |
| 261 | +<p> Do we need a hook for computed values? Interesting. |
| 262 | + We could just hand your callback a set of property values for the element and its parent (maybe siblings, if you ask for it?), |
| 263 | + and you can return a new value for the property. |
| 264 | + This is probably an advanced feature for a later date. |
| 265 | + |
| 266 | +<p> Definitely need a way to listen for elements receiving and changing property values, |
| 267 | + so you can efficiently polyfill things and make your own properties. |
| 268 | + Unsure how it would look at the moment. |
| 269 | + </div> |
| 270 | + |
| 271 | +<h2 class="heading settled heading" data-level=5 id=custom-functions><span class=secno>5 </span><span class=content> |
229 | 272 | Custom Functions</span><a class=self-link href=#custom-functions></a></h2> |
230 | 273 |
|
231 | | - <div class=issue id=issue-7496ea29><a class=self-link href=#issue-7496ea29></a> |
| 274 | + <div class=issue id=issue-a45b4c04><a class=self-link href=#issue-a45b4c04></a> |
232 | 275 | Interesting possibilities here. |
233 | 276 | Definitely need some way to define custom functions in CSS. |
234 | 277 | This would, for example, let people define whatever color function they want, |
@@ -268,11 +311,12 @@ <h2 class="heading settled heading" data-level=4 id=custom-functions><span class |
268 | 311 |
|
269 | 312 | <p> How much can we do in pure CSS? |
270 | 313 | Being able to substitute values depending on MQs or support queries would be useful. |
| 314 | + (However, we can do that much just by using custom properties and <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-variables-1/#funcdef-var title=var()>var()</a>.) |
271 | 315 | To get *real* use out of it, though, I suspect we’d need fuller support for conditionals, |
272 | 316 | likely in the form of SASS’s <span class=css data-link-type=maybe title=@if>@if</span> or something similar. |
273 | 317 | </div> |
274 | 318 |
|
275 | | -<h2 class="heading settled heading" data-level=5 id=custom-combinators><span class=secno>5 </span><span class=content> |
| 319 | +<h2 class="heading settled heading" data-level=6 id=custom-combinators><span class=secno>6 </span><span class=content> |
276 | 320 | Custom Selector Combinators</span><a class=self-link href=#custom-combinators></a></h2> |
277 | 321 |
|
278 | 322 | <div class=issue id=issue-e3f29f62><a class=self-link href=#issue-e3f29f62></a> |
@@ -336,7 +380,7 @@ <h2 class="heading settled heading" data-level=5 id=custom-combinators><span cla |
336 | 380 | so that you’re guaranteed to be called again. |
337 | 381 | </div> |
338 | 382 |
|
339 | | -<h2 class="heading settled heading" data-level=6 id=custom-atrules><span class=secno>6 </span><span class=content> |
| 383 | +<h2 class="heading settled heading" data-level=7 id=custom-atrules><span class=secno>7 </span><span class=content> |
340 | 384 | Custom At-Rules</span><a class=self-link href=#custom-atrules></a></h2> |
341 | 385 |
|
342 | 386 | <div class=issue id=issue-ba92a73c><a class=self-link href=#issue-ba92a73c></a> |
@@ -538,6 +582,45 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In |
538 | 582 | Fill in. |
539 | 583 |
|
540 | 584 | <a href=#issue-cb6e966f> ↵ </a></div><div class=issue> |
| 585 | + Need to more fully support Custom Properties |
| 586 | + (and eventually remove them from the variable spec entirely, since they’ll be defined here). |
| 587 | + |
| 588 | +<p> By default, custom properties are optimized for use as <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-variables-1/#funcdef-var title=var()>var()</a> values—<wbr>they inherit, |
| 589 | + have an empty initial value, |
| 590 | + don’t do any syntax checking, |
| 591 | + and don’t animate. |
| 592 | + All of these should be adjustable somehow. |
| 593 | + |
| 594 | + <pre>@custom-property --foo { |
| 595 | + scope: [ inherit | local ]; |
| 596 | + initial: <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-variables-1/#typedef-any-value title="<any-value>"><any-value></a>*; |
| 597 | + value: <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>"><length></a> <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>"><length></a> <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-color-3/#valuea-def-color title="<color>"><color></a>; |
| 598 | + /* Literally, define a simplistic definition syntax. |
| 599 | + OR FULL CSS PROPERTY GRAMMAR?!? */ |
| 600 | +} |
| 601 | +</pre> |
| 602 | +<p> If you provide a "value" field with animatable types, |
| 603 | + we can animate in the most direct fashion automatically. |
| 604 | + We could also let you hook into that: |
| 605 | + you register a callback, |
| 606 | + and whenever a property starts animating, |
| 607 | + we call it with the starting and ending values. |
| 608 | + You have to return a function which takes a progress value (between 0 and 1) |
| 609 | + and returns a value for your property; |
| 610 | + we’ll call it as we animate the value. |
| 611 | + (How can we hook into Web Anim here? Can you just return an Animation object?) |
| 612 | + |
| 613 | +<p> Do we need a hook for computed values? Interesting. |
| 614 | + We could just hand your callback a set of property values for the element and its parent (maybe siblings, if you ask for it?), |
| 615 | + and you can return a new value for the property. |
| 616 | + This is probably an advanced feature for a later date. |
| 617 | + |
| 618 | +<p> Definitely need a way to listen for elements receiving and changing property values, |
| 619 | + so you can efficiently polyfill things and make your own properties. |
| 620 | + Unsure how it would look at the moment. |
| 621 | + </p><a href=#issue-234df7b0> ↵ </a></div> |
| 622 | + |
| 623 | +<div class=issue> |
541 | 624 | Interesting possibilities here. |
542 | 625 | Definitely need some way to define custom functions in CSS. |
543 | 626 | This would, for example, let people define whatever color function they want, |
@@ -577,9 +660,10 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In |
577 | 660 |
|
578 | 661 | <p> How much can we do in pure CSS? |
579 | 662 | Being able to substitute values depending on MQs or support queries would be useful. |
| 663 | + (However, we can do that much just by using custom properties and <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-variables-1/#funcdef-var title=var()>var()</a>.) |
580 | 664 | To get *real* use out of it, though, I suspect we’d need fuller support for conditionals, |
581 | 665 | likely in the form of SASS’s <span class=css data-link-type=maybe title=@if>@if</span> or something similar. |
582 | | - </p><a href=#issue-7496ea29> ↵ </a></div> |
| 666 | + </p><a href=#issue-a45b4c04> ↵ </a></div> |
583 | 667 |
|
584 | 668 | <div class=issue> |
585 | 669 | Selectors are made of two pieces: |
|
0 commit comments