0.0.1 • Published 3 years ago
@solariera/rgba-syntax v0.0.1
RGBA Syntax
Getting the RGBA syntax for CSS.
1. Usage
1-1. Installation
# npm
npm install @solariera/rgba-syntax
# yarn
yarn add @solariera/rgba-syntax
1-2. Basic Usage
import React from 'react';
import styled from 'styled-components';
import { rgba } from '@solariera/rgba-syntax';
export const ColorText: React.FC = () => {
return <Color { code: '#393D47', alpha: 0.6 }>{'hello world'}</Color>;
};
const Color = styled.div`
color: ${(props) => rgba(props.code, props.alpha)};
${/* rgba(57, 61, 71, 0.6) */}
`;
2. Specifications
2-1. Syntax
rgba(
code
,alpha
)
2-2. Parameters
No. | Name | Type | Description |
---|---|---|---|
1 | code | string | Hexadecimal color code |
2 | alpha | number | Alpha channel value |
0.0.1
3 years ago