File tree 1 file changed +26
-2
lines changed
1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
CSS Paint API Explained
2
2
=======================
3
3
4
- The CSS Paint API is being developered to improve the extensibility of CSS.
4
+ The CSS Paint API is being developed to improve the extensibility of CSS.
5
5
6
- Specifically
6
+ Specifically this allows developers to write a paint function which allows us to draw directly into
7
+ an elements background, border, or content.
7
8
9
+ This work was motivated for a couple of reasons:
10
+
11
+ ### Reduction of DOM ###
12
+
13
+ We noticed that developers are using an increasing amount of DOM to create visual effects. As an
14
+ example the [ <paper-button >] ( https://www.webcomponents.org/element/PolymerElements/paper-button/paper-button )
15
+ uses multiple divs to achieve the "ripple" effect.
16
+
17
+ Instead of using addition divs the developer could just draw directly into the background-image of
18
+ the element instead.
19
+
20
+ This means that the memory and cpu usage of the page would go down, the rendering engine doesn't
21
+ have to keep in memory the additional DOM nodes, in addition to performing style-recalc, layout,
22
+ painting for all these additional divs.
23
+
24
+ ### Extensibility of CSS ###
25
+
26
+ We believe that allowing developers to extend CSS is good for the ecosystem. As an example if a
27
+ developer wanted an additional feature they could implement it themselves. E.g. if the developer
28
+ wanted a new type of dashed border, they shouldn't have to wait for browsers to implement this.
29
+
30
+ They should have the power to implement this themselves with the same capability as the rendering
31
+ engine.
8
32
9
33
Getting Started
10
34
---------------
You can’t perform that action at this time.
0 commit comments