Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@clds/typography
Advanced tools
Documentation of the Cloudinary Typography
component.
The purpose of this component is to use display typography in the right scale and proportion according to predefind sizes.
For each type props the component will assign the following values: font-size
, color
, line-height
, weight
Install the package using Yarn:
pnpm add @clds/typography
import Typography from '@clds/typography';
const Component = () => <Typography>Hello World</Typography>;
Name | Req | Type | Default |
---|---|---|---|
size | false | ['xxl', 'xl', 'lg', 'md', 'sm', 'xs', 'xxs'] | 'sm' |
type | false | ['contrastInvert', 'regular', 'highContrast', 'lowContrast', 'url', 'success', 'warning', 'error', 'disabled'] | 'regular' |
as | false | HTML Tag | span |
If you want to keep all the typography styling you've applied to a component but just switch out what's being ultimately rendered (be it a different HTML tag), you can use the "as" prop to do this at runtime.
<Typography as="h1">Hello World</Typography> // <h1>Hello World</h1>
function(props: object, options: object)
In some cases when you like to use the typography sizes but not as a component, you can use this helper function to consume it as css.
please note: while using this helper u need to make sure to pass the size
and type
prop.
Name | Type | Default |
---|---|---|
asObject | return attrs as object instead of css | false |
import { typographyMixin } from '@clds/typography';
import styled from 'styled-component';
const Div = styled.div`
${typographyMixin};
`;
<Div size="sm" weight="regular" />;
For use cases when you need to attach specific typography to created styled component, you can use predefined mixins, like:
import { typography } from '@clds/typography';
import styled from 'styled-components';
const MyComponent = styled.div`
${typography.sm.url};
// ... rest of your style
`;
This library follows Semantic Versioning.
See LICENSE
FAQs
---
We found that @clds/typography 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.