Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@entur/tokens
Advanced tools
This package contains all design tokens used throughout the design system. You'l find all of them in the `src/tokens.ts` file.
This package contains all design tokens used throughout the design system. You'l find all of them in the src/tokens.ts
file.
💡 Looking for the documentation?
npm install @entur/tokens
# or if you are using Yarn:
yarn add @entur/tokens
Please refer to the documentation for in-depth usage information.
This package has several main exports:
To use the CSS file, import it into your bundle like so:
import '@entur/tokens/dist/styles.css';
You'll then have access to all design tokens as CSS variables. You can then use them like so:
.custom-box {
background-color: var(--colors-greys-grey10);
color: var(--colors-brand-coral);
font-size: var(--font-sizes-medium);
margin: var(--space-medium) var(--space-large);
}
Please refer to the design system documentation for which ones are available.
To use the LESS or SCSS files, import it into your LESS or SCSS file. The method is the same:
@import '~@entur/tokens/dist/styles.less';
@import '~@entur/tokens/dist/styles.scss';
You'll then be able to use the variables in your code as usual.
// LESS
.custom-box {
background-color: @colors-greys-grey10;
color: @colors-brand-coral;
font-size: @font-sizes-medium;
margin: @space-medium @space-large;
}
// SCSS
.custom-box {
background-color: $colors-greys-grey10;
color: $colors-brand-coral;
font-size: $font-sizes-medium;
margin: $space-medium $space-large;
}
To use the design tokens in JavaScript, import the ones you need like so:
import { StyleSheet } from 'react-native';
import { colors, breakpoints, fontSizes } from '@entur/tokens';
StyleSheet.create({
example: {
fontSize: fontSizes.medium,
color: colors.brand.coral,
},
});
These values are mainly provided in pixels. If you need the values in rem instead, add a .rem
after the token name, e.g. space.rem.large
for rem value and space.large
for pixel value.
FAQs
This package contains all design tokens and design variables used throughout the design system. We are currently in a process to migrate over to a new design variable system based on [Figma Variables](https://help.figma.com/hc/en-us/articles/1533965713538
The npm package @entur/tokens receives a total of 1,496 weekly downloads. As such, @entur/tokens popularity was classified as popular.
We found that @entur/tokens 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
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.