Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@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 25,403 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 5 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.