1.1.0 • Published 4 years ago

stitches-utils v1.1.0

Weekly downloads
58
License
MIT
Repository
github
Last release
4 years ago

stitches-utils

Helpful stitches utilities like marginY, marginX etc. combined in one package

GitHub release issues


Installation:

yarn add stitches-utils

or

nom install stitches-utils

Usage:

Import all utils

import { createStyled } from "@stitches/react";
import * as utils from "stitches-utils";

export const { styled, css } = createStyled({
  utils,
});

Import specific utils

import { createStyled } from "@stitches/react";
import { mx, my } from "stitches-utils";

export const { styled, css } = createStyled({
  utils: {
    mx,
    my,
  },
});

Utils overview:

UtilityProperties
mmarginTop, marginRight, marginBottom, marginLeft
mtmarginTop
mrmarginRight
mbmarginBottom
mlmarginLeft
mx, marginXmarginLeft, marginRight
my, marginYmarginTop, marginBottom
ppaddingTop, paddingRight, paddingBottom, paddingLeft
ptpaddingTop
prpaddingRight
pbpaddingBottom
plpaddingLeft
px, paddingXpaddingLeft, paddingRight
py, paddingYpaddingTop, paddingBottom
brborderRadius
btlrborderTopLeftRadius
btrrborderTopRightRadius
bblrborderBottomLeftRadius
bbrrborderBottomRightRadius
wwidth
minWminWidht
maxWmaxWidth
hheight
minHminHeight
maxHmaxHeight
boxSizewidth, height

Custom utils:

It's also possible to build custom utils by using the composeUtil function.

import { createStyled } from "@stitches/react";
import { composeUtil } from "stitches-utils";

const size = composeUtil("width", "height");

export const { styled, css } = createStyled({
  utils: {
    size,
  },
});