Skip to content

Commit 12284d8

Browse files
committed
upd
1 parent e03b90b commit 12284d8

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

  • src/overview/xml-capabilities

src/overview/xml-capabilities/jet.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,19 @@ The `key` attribute is reserved for uniquely identifying interpolated collection
1818

1919
## Linking cascading style sheets
2020

21-
`stylesheet:` attributes are used for linking style sheets (`stylesheet:link={source}`) and argumenting the stylesheet (like `stylesheet:color="red"`, which is referred by the style sheet as `param(color)`).
21+
`<j:Style>` tags are used for linking style sheets to the parent tag and passing arguments to the style sheet (which are referred by the style sheet as `param(color)`).
2222

2323
```
2424
package com.fun.components {
2525
//
2626
public function CustomComponent() {
27-
const stylesheet =
28-
"""
29-
:host { color: param(color) }
30-
""";
31-
3227
return (
33-
<j:Button
34-
stylesheet:link={stylesheet}
35-
stylesheet:color="yellow">
28+
<j:Button>
29+
<j:Style color="yellow">
30+
<![CDATA[
31+
:host { color: param(color) }
32+
]]>
33+
</j:Style>
3634
click me
3735
</j:Button>
3836
);
@@ -50,9 +48,8 @@ package com.fun.components {
5048
const stylesheet = Embed("CustomComponent.css", static="text/plain");
5149
5250
return (
53-
<j:Button
54-
stylesheet:link={stylesheet}
55-
stylesheet:color="yellow">
51+
<j:Button>
52+
<j:Style source={stylesheet} color="yellow"/>
5653
Click me
5754
</j:Button>
5855
);
@@ -66,10 +63,7 @@ package com.fun.components {
6663

6764
#### Linking style sheets in custom components
6865

69-
For a component to support `stylesheet:` attributes, it simply needs to support a `stylesheet : [Fuse::StyleSheet]` parameter.
70-
71-
- When a `stylesheet:link` attribute is given a `[Fuse::StyleSheet]`, it will not consume the given `stylesheet:` parameters and will instead add the `Fuse::StyleSheet`s directly, in attribute order.
72-
- The `stylesheet:link` attribute may appear multiple times.
66+
For a component to support `<j:Style>` tags, it simply needs to support a `stylesheet : [Fuse::StyleSheet]` parameter.
7367

7468
```
7569
package com.fun.components {
@@ -82,7 +76,10 @@ package com.fun.components {
8276
//
8377
8478
return (
85-
<j:Button stylesheet:link={stylesheet}>Click me</j:Button>
79+
<j:Button>
80+
<j:Style source={stylesheet}/>
81+
Click me
82+
</j:Button>
8683
);
8784
}
8885
}

0 commit comments

Comments
 (0)