Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@beatgig/synth-css
Advanced tools
@beatgig/synth-css
CSS bindings for Synth.
yarn add @beatgig/synth-css
string
Returns CSS declaration for the background-color
property.
string
Returns CSS declaration for the border
property.
string
Returns CSS declaration for the border-radius
property.
string
Returns CSS declaration for the bottom
property.
string
Returns CSS declaration for the box-shadow
property.
string
Returns CSS declaration for the color
property.
string
Returns CSS declaration for the font-family
property.
string
Returns CSS declaration for the font-size
property.
string
Returns CSS declaration for the font-weight
property.
string
Returns CSS declaration for the height
property.
string
Returns CSS declaration for the left
property.
string
Returns CSS declaration for the letter-spacing
property.
string
Returns CSS declaration for the line-height
property.
string
Returns CSS declaration for the margin
property.
string
Returns CSS declaration for the max-height
property.
string
Returns CSS declaration for the max-width
property.
string
Returns CSS declaration for the min-height
property.
string
Returns CSS declaration for the min-width
property.
string
Returns CSS declaration for the opacity
property.
string
Returns CSS declaration for the outline
property using box-shadow
.
string
Returns CSS declaration for the padding
property.
string
Returns CSS declaration for the right
property.
string
Returns CSS declaration for the text-decoration
property.
string
Returns CSS declaration for the text-transform
property.
string
Returns CSS declaration for the top
property.
string
Returns CSS declaration for the width
property.
CSSBindings
Returns an object containing all CSS helper functions with the given
tokens
already passed as the first argument.
string
Returns CSS declaration for the z-index
property.
object
string
Returns CSS declaration for the background-color
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { backgroundColor } from '@beatgig/synth-css'
backgroundColor({
color: {
background: {
primaryButton: '#333',
},
},
}, 'primaryButton')
// => background-color: #333;
backgroundColor({
color: {
background: {
primaryButton: '#333',
'primaryButton:hover': '#111',
},
},
}, 'primaryButton:hover')
// => background-color: #111;
string
Returns CSS declaration for the border
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { border } from '@beatgig/synth-css'
border({
color: {
border: {
default_button: '#333',
'default_button:hover': '#111',
},
},
size: {
border: {
default_button: '1px',
'default_button:hover': '2px',
},
},
style: {
border: {
default_button: 'solid',
'default_button:hover': 'solid',
},
}
}, 'default_button')
// => border-width: 1px; border-style: solid; border-color: #333;
border({
color: {
border: {
default_button: '#333',
'default_button:hover': '#111',
},
},
size: {
border: {
default_button: '1px',
'default_button:hover': '2px',
},
},
style: {
border: {
default_button: 'solid',
'default_button:hover': 'solid',
},
}
}, 'default_button:hover')
// => border-width: 2px; border-style: solid; border-color: #111;
string
Returns CSS declaration for the border-radius
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { borderRadius } from '@beatgig/synth-css'
borderRadius({
size: {
radius: {
'primary-button': '5px',
'primary-button:disabled': '0px',
},
},
}, 'primary-button')
// => border-radius: 5px;
borderRadius({
size: {
radius: {
'primary-button': '5px',
'primary-button:disabled': '0px',
},
},
}, 'primary-button:disabled')
// => border-radius: 0px;
string
Returns CSS declaration for the bottom
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { bottom } from '@beatgig/synth-css'
bottom({
position: {
bottom: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button')
// => bottom: 15px;
bottom({
position: {
bottom: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button:disabled')
// => bottom: 25px;
string
Returns CSS declaration for the box-shadow
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { boxShadow } from '@beatgig/synth-css'
boxShadow({
style: {
shadow: {
textInput: '0 0 1px #333',
'textInput:focus': '0 0 3px #333',
},
},
}, 'textInput')
// => box-shadow: 0 0 1px #333;
boxShadow({
style: {
shadow: {
textInput: '0 0 1px #333',
'textInput:focus': '0 0 3px #333',
},
},
}, 'textInput:focus')
// => box-shadow: 0 0 3px #333;
string
Returns CSS declaration for the color
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { color } from '@beatgig/synth-css'
color({
color: {
text: {
caption: '#333',
'caption:hover': '#555',
},
},
}, 'caption')
// => color: #333;
color({
color: {
text: {
caption: '#333',
'caption:hover': '#555',
},
},
}, 'caption:hover')
// => color: #555;
string
Returns CSS declaration for the font-family
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { fontFamily } from '@beatgig/synth-css'
fontFamily({
typography: {
font: {
text_field: 'helvetica',
'text_field:disabled': 'arial',
},
},
}, 'text_field')
// => font-family: helvetica;
fontFamily({
typography: {
font: {
text_field: 'helvetica',
'text_field:disabled': 'arial',
},
},
}, 'text_field:disabled')
// => font-family: arial;
string
Returns CSS declaration for the font-size
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { fontSize } from '@beatgig/synth-css'
fontSize({
typography: {
size: {
menu_link: '16px',
'menu_link:disabled': '14px',
},
},
}, 'menu_link')
// => font-size: 16px;
fontSize({
typography: {
size: {
menu_link: '16px',
'menu_link:disabled': '14px',
},
},
}, 'menu_link:disabled')
// => font-size: 14px;
string
Returns CSS declaration for the font-weight
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { fontWeight } from '@beatgig/synth-css'
fontWeight({
typography: {
weight: {
'menu-link': '300',
'menu-link:hover': '600',
},
},
}, 'menu-link')
// => font-weight: 300;
fontWeight({
typography: {
weight: {
'menu-link': '300',
'menu-link:hover': '600',
},
},
}, 'menu-link:hover')
// => font-weight: 600;
string
Returns CSS declaration for the height
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { height } from '@beatgig/synth-css'
height({
size: {
height: {
button: '100%',
'button:hover': '120%',
},
},
}, 'button')
// => height: 100%;
height({
size: {
height: {
button: '100%',
'button:hover': '120%',
},
},
}, 'button:hover')
// => height: 120%;
string
Returns CSS declaration for the left
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { left } from '@beatgig/synth-css'
left({
position: {
left: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button')
// => left: 15px;
left({
position: {
left: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button:disabled')
// => left: 25px;
string
Returns CSS declaration for the letter-spacing
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { letterSpacing } from '@beatgig/synth-css'
letterSpacing({
typography: {
spacing: {
'menu-link': 'normal',
'menu-link:disabled': '4px',
},
},
}, 'menu-link')
// => letter-spacing: normal;
letterSpacing({
typography: {
spacing: {
'menu-link': 'normal',
'menu-link:disabled': '4px',
},
},
}, 'menu-link:disabled')
// => letter-spacing: 4px;
string
Returns CSS declaration for the line-height
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { lineHeight } from '@beatgig/synth-css'
lineHeight({
typography: {
lineHeight: {
'menu_link': 1.5,
'menu_link:disabled': 1.65,
},
},
}, 'menu_link')
// => line-height: 1.5;
lineHeight({
typography: {
lineHeight: {
'menu_link': 1.5,
'menu_link:disabled': 1.65,
},
},
}, 'menu_link:disabled')
// => line-height: 1.65;
string
Returns CSS declaration for the margin
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { margin } from '@beatgig/synth-css'
margin({
space: {
margin: {
'primaryButton': '10%',
'primaryButton:hover': '25%'
},
},
}, 'primaryButton')
// => margin: 10%;
margin({
space: {
margin: {
'primaryButton': '10%',
'primaryButton:hover': '25%'
},
},
}, 'primaryButton:hover')
// => margin: 25%;
string
Returns CSS declaration for the max-height
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { maxHeight } from '@beatgig/synth-css'
maxHeight({
size: {
maxHeight: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton')
// => max-height: 120px;
maxHeight({
size: {
maxHeight: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton:hover')
// => max-height: 100%;
string
Returns CSS declaration for the max-width
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { maxWidth } from '@beatgig/synth-css'
maxWidth({
size: {
maxWidth: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton')
// => max-width: 120px;
maxWidth({
size: {
maxWidth: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton:hover')
// => max-width: 100%;
string
Returns CSS declaration for the min-height
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { minHeight } from '@beatgig/synth-css'
minHeight({
size: {
minHeight: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton')
// => min-height: 120px;
minHeight({
size: {
minHeight: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton:hover')
// => min-height: 100%;
string
Returns CSS declaration for the min-width
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { minWidth } from '@beatgig/synth-css'
minWidth({
size: {
minWidth: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton')
// => min-width: 120px;
minWidth({
size: {
minWidth: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton:hover')
// => min-width: 100%;
string
Returns CSS declaration for the opacity
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { opacity } from '@beatgig/synth-css'
opacity({
style: {
opacity: {
form_button: 1,
'form_button:disabled': 0.5,
},
},
}, 'form_button')
// => opacity: 1;
opacity({
style: {
opacity: {
form_button: 1,
'form_button:disabled': 0.5,
},
},
}, 'form_button:disabled')
// => opacity: 0.5;
string
Returns CSS declaration for the outline
property using box-shadow
.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { outline } from '@beatgig/synth-css'
outline({
color: {
outline: {
modalInput: '#333',
'modalInput:focus': '#222',
},
},
size: {
outline: {
modalInput: '1px',
'modalInput:focus': '3px'
}
}
}, 'modalInput')
// => box-shadow: 0 0 0 1px #333;
outline({
color: {
outline: {
modalInput: '#333',
'modalInput:focus': '#222',
},
},
size: {
outline: {
modalInput: '1px',
'modalInput:focus': '3px'
}
}
}, 'modalInput:focus')
// => box-shadow: 0 0 0 3px #222;
string
Returns CSS declaration for the padding
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { padding } from '@beatgig/synth-css'
padding({
space: {
padding: {
'primaryButton': '10px 15px',
'primaryButton:hover': '15%'
},
},
}, 'primaryButton')
// => padding: 10px 15px;
padding({
space: {
padding: {
'primaryButton': '10px 15px',
'primaryButton:hover': '15%'
},
},
}, 'primaryButton:hover')
// => padding: 15%;
string
Returns CSS declaration for the right
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
right({
position: {
right: {
card_close_button: '15px',
'card_close_button:disabled': '25px'
},
},
}, 'card_close_button')
// => right: 15px;
right({
position: {
right: {
card_close_button: '15px',
'card_close_button:disabled': '25px'
},
},
}, 'card_close_button:disabled')
// => right: 25px;
string
Returns CSS declaration for the text-decoration
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { textDecoration } from '@beatgig/synth-css'
textDecoration({
typography: {
decoration: {
menu_link: 'none',
'menu_link:hover': 'underline',
},
},
}, 'menu_link')
// => text-decoration: none;
textDecoration({
typography: {
decoration: {
menu_link: 'none',
'menu_link:hover': 'underline',
},
},
}, 'menu_link:hover')
// => text-decoration: underline;
string
Returns CSS declaration for the text-transform
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { textTransform } from '@beatgig/synth-css'
textTransform({
typography: {
transform: {
menuLink: 'lowercase',
'menuLink:hover': 'uppercase',
},
},
}, 'menuLink')
// => text-transform: lowercase;
textTransform({
typography: {
transform: {
menuLink: 'lowercase',
'menuLink:hover': 'uppercase',
},
},
}, 'menuLink:hover')
// => text-transform: uppercase;
string
Returns CSS declaration for the top
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { top } from '@beatgig/synth-css'
top({
position: {
top: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button')
// => top: 15px;
top({
position: {
top: {
card_close_button: '15px',
'card_close_button:disabled': '25px',
},
},
}, 'card_close_button:disabled')
// => top: 25px;
string
Returns CSS declaration for the width
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { width } from '@beatgig/synth-css'
width({
size: {
width: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton')
// => width: 120px;
width({
size: {
width: {
primaryButton: '120px',
'primaryButton:hover': '100%',
},
},
}, 'primaryButton:hover')
// => width: 100%;
CSSBindings
Returns an object containing all CSS helper functions with the given
tokens
already passed as the first argument.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
Example
import { withTokens } from '@beatgig/synth-css'
const cssHelpers = withTokens({
color: {
background: {
button: 'red',
},
},
})
cssHelpers.backgroundColor('button')
// => background-color: 'red';
string
Returns CSS declaration for the z-index
property.
Kind: global constant
Since: 1.0.0
Param | Type |
---|---|
tokens | object |
name | string |
Example
import { zIndex } from '@beatgig/synth-css'
zIndex({
position: {
index: {
card_close_button: 1,
'card_close_button:hover': 5
},
},
}, 'card_close_button')
// => z-index: 1;
zIndex({
position: {
index: {
card_close_button: 1,
'card_close_button:hover': 5
},
},
}, 'card_close_button:hover')
// => z-index: 5;
object
Kind: global typedef
Properties
Name | Type |
---|---|
backgroundColor | function |
border | function |
borderRadius | function |
bottom | function |
boxShadow | function |
color | function |
fontFamily | function |
fontSize | function |
fontWeight | function |
height | function |
left | function |
letterSpacing | function |
lineHeight | function |
margin | function |
maxHeight | function |
maxWidth | function |
minHeight | function |
minWidth | function |
opacity | function |
outline | function |
padding | function |
right | function |
textDecoration | function |
textTransform | function |
top | function |
width | function |
zIndex | function |
FAQs
CSS bindings for Synth.
The npm package @beatgig/synth-css receives a total of 2 weekly downloads. As such, @beatgig/synth-css popularity was classified as not popular.
We found that @beatgig/synth-css demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.