Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@umbraco-ui/uui-css
Advanced tools
UUI-CSS package contains css files which can be included in your project or components if needed
uui-font
class on your root element.uui-font
. Set the uui-text
class on the element covering the scope of interest, this can be your root element. And if you want to use the styling inside a Shadow dom, that will have to have the uui-text
class as well. See Applying the uui-css styling in the root.
See examplesBundle:
uui-font
and uui-text
classes.Preview on Storybook
For the best results you should include the uui-css.css
bundle in your project, which contains all the css files and custom variables:
<!-- Latest Version -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-css@latest/dist/uui-css.css" />
<!-- Specific version -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-css@x.x.x/dist/uui-css.css" />
If you want to have fine-grained control over the CSS files, you can install the @umbraco-ui/uui-css
package.
npm i @umbraco-ui/uui-css
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:
// app.ts
import '@umbraco-ui/uui-css/dist/custom-properties.css';
import '@umbraco-ui/uui-css/dist/uui-font.css';
import '@umbraco-ui/uui-css/dist/uui-text.css';
Or you can just import the compiled bundle at once:
// app.ts
import '@umbraco-ui/uui-css/dist/uui-css.css';
Using the uui-font
and uui-text
<body class="uui-font uui-text">
<div id="app">
<h1>Hello uui-css!</h1>
<p>
Everything inside my app will now use the font from uui-font and tag
styling from uui-text because the root(body) has the uui-font and uui-text
classes.
</p>
</div>
</body>
Using the custom properties:
<p style="background: var(--uui-interface-surface-alt);">
I will now have a background color from the custom properties.
</p>
Full example:
<!DOCTYPE html>
<html>
<head>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-css@latest/dist/uui-css.css" />
</head>
<body class="uui-font uui-text">
<div id="app">
<h1>Hello uui-css!</h1>
<p>
Everything inside my app will now use the font from uui-font and tag
styling from uui-text because the root(body) has the uui-font and
uui-text classes.
</p>
<p style="background: var(--uui-interface-surface-alt);">
I will have a background color from the custom properties.
</p>
</div>
</body>
</html>
Import the text css from uui-css
import { UUITextStyles } from '@umbraco-ui/uui-css';
Add the css to the component styles
static styles = [
UUITextStyles,
css`
/* your css goes here */
`,
];
Add the uui-text
class to the root of the component
<div class="uui-text">This is my custom element</div>
Full example:
import { html, css, LitElement } from 'lit';
import { customElement } from 'lit/decorators.js';
import { UUITextStyles } from '@umbraco-ui/uui-css';
@customElement('my-element')
export class MyElement extends LitElement {
static styles = [
UUITextStyles,
css`
/* your css goes here */
`,
];
render() {
return html`
<div class="uui-text">
This is my custom element
</div>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'my-element': MyElement;
}
}
FAQs
Umbraco UI css component
The npm package @umbraco-ui/uui-css receives a total of 494 weekly downloads. As such, @umbraco-ui/uui-css popularity was classified as not popular.
We found that @umbraco-ui/uui-css demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.