Skip to content

Commit a0fe740

Browse files
committed
updated story
1 parent e953c97 commit a0fe740

File tree

1 file changed

+61
-6
lines changed

1 file changed

+61
-6
lines changed

packages/uui-css/lib/uui-css.story.ts

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export default {
99
docs: {
1010
source: {
1111
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';
1616
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';
1919
`,
2020
},
2121
},
@@ -48,3 +48,58 @@ export const Overview: Story = () => html` <article style="max-width:580px;">
4848
</li>
4949
</ul>
5050
</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

Comments
 (0)