@@ -9,13 +9,13 @@ export default {
9
9
docs : {
10
10
source : {
11
11
code : `
12
- // Include each of the following:
13
- import '@umbraco-ui/uui-css/dist/custom-properties.css';
14
- import '@umbraco-ui/uui-css/dist/uui-font.css';
15
- import '@umbraco-ui/uui-css/dist/uui-text.css';
12
+ // Include each of the following:
13
+ import '@umbraco-ui/uui-css/dist/custom-properties.css';
14
+ import '@umbraco-ui/uui-css/dist/uui-font.css';
15
+ import '@umbraco-ui/uui-css/dist/uui-text.css';
16
16
17
- // Alternatively include the compiled bundle
18
- import '@umbraco-ui/uui-css/dist/uui-css.css';
17
+ // Alternatively include the compiled bundle
18
+ import '@umbraco-ui/uui-css/dist/uui-css.css';
19
19
` ,
20
20
} ,
21
21
} ,
@@ -48,3 +48,58 @@ export const Overview: Story = () => html` <article style="max-width:580px;">
48
48
</ li >
49
49
</ ul >
50
50
</ article > `;
51
+
52
+ export const Usage : Story = ( ) => html `
53
+ < div class ="uui-text ">
54
+ < h1 > Hello uui-css!</ h1 >
55
+ < p >
56
+ This component will now use the styling from uui-text because the root of
57
+ the component has the uui-text class.
58
+ </ p >
59
+ < p style ="background: var(--uui-interface-surface-alt); ">
60
+ this paragraph uses a custom property from the uui custom properties to
61
+ set its background color.
62
+ </ p >
63
+ </ div >
64
+ ` ;
65
+ Usage . parameters = {
66
+ docs : {
67
+ source : {
68
+ code : `
69
+ import { html, css, LitElement } from 'lit';
70
+ import { customElement } from 'lit/decorators.js';
71
+ import { UUITextStyles } from '@umbraco-ui/uui-css';
72
+
73
+ @customElement('my-element')
74
+ export class MyElement extends LitElement {
75
+ static styles = [
76
+ UUITextStyles,
77
+ css\`
78
+ /* your css goes here */
79
+ \`,
80
+ ];
81
+
82
+ render() {
83
+ return html\`
84
+ <div class="uui-text">
85
+ <h1>Hello uui-css!</h1>
86
+ <p>
87
+ This component will now use the styling from uui-text because the root of the component has the uui-text class.
88
+ </p>
89
+ <p style="background: var(--uui-interface-surface-alt);">
90
+ this paragraph uses a custom property from the uui custom properties to set its background color.
91
+ </p>
92
+ </div>
93
+ \`;
94
+ }
95
+ }
96
+
97
+ declare global {
98
+ interface HTMLElementTagNameMap {
99
+ 'my-element': MyElement;
100
+ }
101
+ }
102
+ ` ,
103
+ } ,
104
+ } ,
105
+ } ;
0 commit comments