Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@atlaskit/editor-palette
Advanced tools
Readme
When adding support for themed content to tooling which interacts with adf content -- the decision was made to treat existing hex codes as a unique id, and link them to design tokens which have theme specific versions.
By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
Detailed docs and example usage can be found here.
yarn add @atlaskit/editor-palette
This takes an adf hex color and returns a matching background palette color.
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
const cssValue = hexToBackgroundPaletteColor('#FFFFFF');
// ^? const cssValue: 'var(--ds-surface, #FFFFFF)'
<div style={{backgroundColor: cssValue}} />
The names of tokens can change over time, and the values of tokens will differ between themes.
The exact output of this function is an implementation detail and should only be used when rendering
content to the user, on a client with a matching major version of @atlaskit/tokens
.
This takes an adf hex color and returns a matching text palette color.
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
const cssValue = hexToEditorTextPaletteColor('#0747A6');
// ^? const cssValue: 'var(--ds-text-accent-blue, #0747A6)'
<span style={{textColor: cssValue}} />
The names of tokens can change over time, and the values of tokens will differ between themes.
The exact output of this function is an implementation detail and should only be used when rendering
content to the user, on a client with a matching major version of @atlaskit/tokens
.
This takes an adf hex color and returns a matching border palette color.
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
const cssValue = hexToEditorBorderPaletteColor('#091E4224');
// ^? const cssValue: 'var(--ds-border, #091E4224)'
<span style={{borderColor: cssValue}} />
The names of tokens can change over time, and the values of tokens will differ between themes.
The exact output of this function is an implementation detail and should only be used when rendering
content to the user, on a client with a matching major version of @atlaskit/tokens
.
FAQs
The editor palette
The npm package @atlaskit/editor-palette receives a total of 10,036 weekly downloads. As such, @atlaskit/editor-palette popularity was classified as popular.
We found that @atlaskit/editor-palette demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).