🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@bukinoshita/space

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bukinoshita/space

A spacing util

0.0.7
latest
npm
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Space Build Status

A spacing util

Install

$ yarn add @bukinoshita/space

Usage

Example with styled-jsx.

// theme/space.ts
import { Space } from '@bukinoshita/space'

// It uses the `4px` grid by default
export const space = new Space()
// components/my-component.tsx
import { space } from 'theme/spacing'

const MyComponent = () => (
  <div>
    <h1>Nice</h1>

    <style jsx={true}>
    {`
      h1 {
        margin-bottom: ${space.spacing(2)} // 8px;
        color: black;
      }
    `}
    </style>
  </div>
)

You can find more example here.

API

Space(grid, unit)

grid

Type: number
Default: 4
Optional

unit

Type: string
Default: px
Optional

.spacing(value)

value

Type: number
Required

License

MIT © Bu Kinoshita

Keywords

space

FAQs

Package last updated on 14 Jul 2020

Did you know?

Socket

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.

Install

Related posts