
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@leafygreen-ui/tokens
Advanced tools
@leafygreen-ui/tokens is a design token library provided by MongoDB's LeafyGreen UI team. It offers a set of design tokens that can be used to maintain consistency in design across different components and applications. These tokens include colors, typography, spacing, and other design-related constants.
Colors
This feature provides a set of predefined color tokens that can be used to ensure consistent color usage across your application.
import { color } from '@leafygreen-ui/tokens';
const primaryColor = color.green.base;
console.log(primaryColor); // Outputs: '#13AA52'
Typography
This feature offers typography tokens such as font sizes and line heights to maintain consistent text styling.
import { fontSize, lineHeight } from '@leafygreen-ui/tokens';
const headingStyle = {
fontSize: fontSize.h1,
lineHeight: lineHeight.h1,
};
console.log(headingStyle); // Outputs: { fontSize: '32px', lineHeight: '40px' }
Spacing
This feature provides spacing tokens that can be used for margins and paddings to ensure consistent spacing throughout your application.
import { spacing } from '@leafygreen-ui/tokens';
const containerStyle = {
padding: spacing[4],
};
console.log(containerStyle); // Outputs: { padding: '16px' }
Styled System provides a set of utilities for building design systems and consistent UI components. It offers a similar approach to design tokens but is more focused on providing utility functions for styling components.
Theme UI is a library for creating themeable user interfaces based on constraint-based design principles. It offers a more comprehensive solution for theming and design tokens, including support for custom themes and responsive design.
Tailwind CSS is a utility-first CSS framework that provides low-level utility classes for building custom designs. While it doesn't use design tokens in the same way, it offers a similar level of consistency and reusability in design.
yarn add @leafygreen-ui/tokens
npm install @leafygreen-ui/tokens
import { spacing, fontFamilies, breakpoints, transitionDuration } from '@leafygreen-ui/tokens';
const spacingExample = () => <span style={{ margin: spacing[1] }}>Hello World</span>;
const fontFamiliesExample = () => <span style={{ font-family: fontFamilies.default }}>Hello World</span>;
const mq = facepaint(
breakpoints.map(bp => `@media (min-width: ${bp}px)`),
{ literal: true },
);
const transitionDurationExample = <span style={{ transition: transitionDuration.default }}>Hello World</span>;
FAQs
leafyGreen UI Kit Tokens
The npm package @leafygreen-ui/tokens receives a total of 151,255 weekly downloads. As such, @leafygreen-ui/tokens popularity was classified as popular.
We found that @leafygreen-ui/tokens demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.