Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@budiq/design-tokens
Advanced tools
Visual primitives such as typography, color, and spacing that are shared across platforms.
Visual primitives such as typography, color, and spacing that are shared across platforms.
Depending on your preference, run one of the following in your terminal:
# With npm
npm install @sumup/design-tokens
# With yarn v1
yarn add @sumup/design-tokens
The package currently exports a single light
theme that is meant to be used with SumUp's React component library, Circuit UI. Pass the theme to Emotion's ThemeProvider
:
import { light } from '@sumup/design-tokens';
import { ThemeProvider } from '@emotion/react';
import styled from '@emotion/styled';
const Bold = styled.strong`
font-weight: ${(p) => p.theme.fontWeight.bold};
`;
const App = () => (
<ThemeProvider theme={light}>
<Bold>This styled component has access to the theme.</Bold>
</ThemeProvider>
);
The theme is a plain JavaScript object, so you can use it in other ways, too.
The package exports a themePropType
which can be used to check the theme
prop:
import PropTypes from 'prop-types';
import { withTheme } from '@emotion/react';
import { themePropType } from '@sumup/design-tokens';
function ComponentWithInlineStyles({ theme, label }) {
return <div style={{ color: theme.colors.p500 }}>{label}</div>;
}
ComponentWithInlineStyles.propTypes = {
theme: themePropType.isRequired,
label: PropTypes.string,
};
export default function withTheme(ComponentWithInlineStyles);
The package exports a Theme
interface which can be used to type Emotion's styled
function. Create a custom styled
instance as described in the Emotion docs:
import styled, { CreateStyled } from '@emotion/styled';
import { Theme } from '@sumup/design-tokens';
export default styled as CreateStyled<Theme>;
FAQs
Visual primitives such as typography, color, and spacing that are shared across platforms.
We found that @budiq/design-tokens demonstrated a not healthy version release cadence and project activity because the last version was released 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.