
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@episerver/design-tokens
Advanced tools
Theme variables as JSON, SASS, and LESS. It's used in UI Framework and its dependents. Can be used independently to get Episerver themes, useful for doing a UI Refresh of an existing frontend.
Add @episerver/design-tokens
as a dependency
yarn add @episerver/design-tokens
It includes design tokens in JSON, SASS, and LESS.
import variables from "@episerver/design-tokens/dist/json/variables";
They follow a basic structure of
[
{
"name": "token-name",
"val1": "some value",
"val2": "some other value"
}
]
The first element is a flat object:
{
"font-family": "Barlow, sans-serif",
"font-family-monospace": "Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",
"font-size-monospace": "13px",
"font-weight-regular": 400,
"font-weight-medium": 500,
"font-weight-bold": 700,
"text-emphasis-high": 0.87,
"text-emphasis-medium": 0.6,
"text-emphasis-disabled": 0.38,
"text-color-emphasis-high": "rgba(0, 0, 0, 0.87)",
"text-color-emphasis-medium": "rgba(0, 0, 0, 0.6)",
"text-color-emphasis-disabled": "rgba(0, 0, 0, 0.38)"
},
Subsequent elements are either color, typography, or shape:
{
"name": "color-primary-500",
"hex": "1456f1",
"alpha": 1
},
{
"name": "typography-styles-body1",
"letterSpacing": 0,
"lineHeight": 19,
"font": {
"postscriptName": "Barlow-Regular",
"family": "Barlow",
"size": 16,
"weight": "regular",
"stretch": "normal"
},
"color": {
"hex": "000000",
"alpha": 0.87
}
},
{
"name": "shape-medium-component-radius",
"radius": "4px"
},
The tokens are under rapid development so their interfaces can change at any time.
@use "@episerver/design-tokens/dist/scss/variables" as epi;
$your-theme-primary: epi.$color-primary-500;
Setting up SASS with a project using webpack is very quick.
yarn add --dev sass-loader node-sass
webpack.config.js
for .scss files{
test: /\.scss$/,
loaders: [
"style-loader",
"css-loader",
{
loader: "sass-loader",
options: {
includePaths: ["node_modules"]
}
}
],
include: path.resolve(__dirname, "../")
}
@import "@episerver/design-tokens/dist/less/_variables";
@your-theme-primary: @color-primary-500;
Setting up LESS with a project using gulp is very quick.
yarn add --dev gulp-less
gulpfile.js
for .less files, or change an existing task.task("build-less", () => {
return src(["**/*.less"]).pipe(
less({
paths: [path.join(__dirname, "node_modules")],
})
);
});
The tokens in the Design System (and the components in the UI Framework) use a custom font which you need to load in the appropriate manner for your application.
Loading the font via Google Fonts is the preferred approach as it will provide the best performance, and it only requires that you add a link in the head of the HTML document.
<link href="https://fonts.googleapis.com/css?family=Barlow" rel="stylesheet" />
Depending on the site setup, this may require changes to the content security policy for the site. The following rules would be needed in that case:
style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com
If the application can be used in scenarios where loading external resources is potentially forbidden, then you can bundle the fonts with your application by adding the following to your entry point file. You will need to take a dependency on UI Framework and follow the readme there for "Local Fonts".
Releases will be created at the team's discretion. This should be done regularly when there are bug fixes or new features available. Releases follow semantic versioning. This means that, until there is a major version, minor versions may contain breaking changes.
See the CHANGELOG.md document for information about what is included in each release.
See the GUIDELINES.md document for more information about contributing and the release process.
FAQs
Re-usable design tokens to be used within Episerver themes.
We found that @episerver/design-tokens demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.