Skip to content

Commit b0f9e17

Browse files
authored
Merge pull request #134 from umbraco/bugfix/16713-missing-font
2 parents ea98e44 + 7ebcbe0 commit b0f9e17

15 files changed

+338
-187
lines changed

.storybook/preview-body.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<script>
2-
document.body.classList.add('uui-root');
2+
document.body.classList.add('uui-font');
33
document.body.classList.add('uui-text');
44
</script>

package-lock.json

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"postcss-custom-properties-fallback": "1.0.1",
9595
"postcss-jsx": "0.36.4",
9696
"postcss-load-config": "3.1.0",
97+
"postcss-url": "^10.1.3",
9798
"postcss-values-parser": "6.0.0",
9899
"prettier": "2.5.1",
99100
"rimraf": "3.0.2",

packages/uui-css/README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,53 @@
55
UUI-CSS package contains css files which can be included in your project or components if needed
66

77
- **custom-properties.css** — use this if you like to include our custom properties in your project.
8-
- **local-typography.css** — use this if you like to declare styles for typography, this is needed when using ex.: H1 in a Shadow DOM.
9-
- **root.css** — If you like your project to be styled for Umbraco UI, then include this in the root of your project.
8+
- **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.
10+
11+
Bundle:
12+
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.
14+
15+
# Usage in your project
16+
17+
## CDN
18+
19+
For the best results you should include the `uui-css.css` bundle in your project, which contains all the css files and custom variables:
20+
21+
```html
22+
<!-- Latest Version -->
23+
<link
24+
rel="stylesheet"
25+
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-css@latest/dist/uui-css.css" />
26+
27+
<!-- Specific version -->
28+
<link
29+
rel="stylesheet"
30+
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/[email protected]/dist/uui-css.css" />
31+
```
1032

1133
## Installation
1234

35+
If you want to have fine-grained control over the CSS files, you can install the `@umbraco-ui/uui-css` package.
36+
1337
```zsh
1438
npm i @umbraco-ui/uui-css
1539
```
1640

1741
## Usage
1842

19-
```html
20-
<style src="@umbraco-ui/uui-css/root.css"></style>
43+
For a build system like _Vite_, the styling could be included like this if you want to control the styling and variables with the build system:
44+
45+
```ts
46+
// app.ts
47+
import '@umbraco-ui/uui-css/dist/custom-properties.css';
48+
import '@umbraco-ui/uui-css/dist/uui-font.css';
49+
import '@umbraco-ui/uui-css/dist/uui-text.css';
50+
```
51+
52+
Or you can just import the compiled bundle at once:
53+
54+
```ts
55+
// app.ts
56+
import '@umbraco-ui/uui-css/dist/uui-css.css';
2157
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const Typography = () => html`
9292
<h2>Setup</h2>
9393
<p>
9494
The Umbraco Typography can be used on a full web application or on a
95-
dedicated spot. To set the font use the <b>uui-root</b> class on the root
95+
dedicated spot. To set the font use the <b>uui-font</b> class on the root
9696
element or a element of interest. Additionally the <b>uui-text</b> class
9797
must be set to expose the Umbraco Typography Styles. See the UUI-CSS
9898
package for more.

0 commit comments

Comments
 (0)