Skip to content

Commit c1d54bc

Browse files
committed
doc
1 parent bcf4ec2 commit c1d54bc

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

packages/uui-css/README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ UUI-CSS package contains css files which can be included in your project or comp
66

77
- **custom-properties.css** — use this if you like to include our custom properties in your project.
88
- **uui-font.css** — use this if you like to import our font in your project. You must set the `uui-font` class on your root element.
9-
- **uui-text.css** — use this if you like to declare styles for typography, this is needed when using ex.: H1 in a Shadow DOM. You must set the `uui-text` class in your root element.
9+
- **uui-text.css** — use this if you like to declare styles for typography for tags such as h1, h2. You must set the `uui-text` class on your root element. And if you wan't to use the styling inside a Shadow dom, that will have to have the `uui-text` class as well.
1010

1111
Bundle:
1212

13-
- **uui-css.css** — If you like your project to be styled for Umbraco UI, then include this in the root of your project. This contains all the previous files, so make sure to only include this file in your project if you need to style your project.
13+
- **uui-css.css** — If you like your project to be styled for Umbraco UI, then include this in the root of your project. This contains all the previous files, so make sure to only include this file in your project if you need to style your project. You will still have to apply the `uui-font` and `uui-text` classes.
1414

1515
### See it in action
1616

@@ -59,3 +59,54 @@ Or you can just import the compiled bundle at once:
5959
// app.ts
6060
import '@umbraco-ui/uui-css/dist/uui-css.css';
6161
```
62+
63+
### Applying the uui-css styling
64+
65+
Using the `uui-font` and `uui-text`
66+
67+
```html
68+
<div id="app" class="uui-font uui-text">
69+
<h1>Hello uui-css!</h1>
70+
<p>
71+
Everything inside my app will now use the font from uui-font and tag styling
72+
from uui-text because the app root has the uui-font and uui-text classes.
73+
</p>
74+
<p style="background: var(--uui-interface-surface-alt);">
75+
I will have a background color from the custom properties.
76+
</p>
77+
</div>
78+
```
79+
80+
using the custom properties
81+
82+
```html
83+
<p style="background: var(--uui-interface-surface-alt);">
84+
I will have a background color from the custom properties.
85+
</p>
86+
```
87+
88+
Full example:
89+
90+
```html
91+
<!DOCTYPE html>
92+
<html>
93+
<head>
94+
<link
95+
rel="stylesheet"
96+
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-css@latest/dist/uui-css.css" />
97+
</head>
98+
<body>
99+
<div id="app" class="uui-font uui-text">
100+
<h1>Hello uui-css!</h1>
101+
<p>
102+
Everything inside my app will now use the font from uui-font and tag
103+
styling from uui-text because the app root has the uui-font and uui-text
104+
classes.
105+
</p>
106+
<p style="background: var(--uui-interface-surface-alt);">
107+
I will have a background color from the custom properties.
108+
</p>
109+
</div>
110+
</body>
111+
</html>
112+
```

0 commit comments

Comments
 (0)