css-property-normalize
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

css-property-normalize

Function for checking and validating css properties

Installation

yarn add css-property-normalize # npm i css-property-normalize

Usage

Basic usage:

cssPropertyNormalize(property: string, toCamelCase?: boolean): string

import cssPropertyNormalize from 'css-property-normalize'
// Usage in webkit-browser:
console.log(cssPropertyNormalize('perspective-origin-y'))
console.log(cssPropertyNormalize('perspectiveOriginY'))
console.log(cssPropertyNormalize('ms-Perspective --- origin-Y'))
/* RETURN: */
;('-webkit-perspective-origin-y') // in webkit browsers
/* RETURN IN NODEJS: */
;('perspective-origin-y')

console.log(cssPropertyNormalize('--Custom  modify')) // --custom-modify

console.log(cssPropertyNormalize('user-modify'))
/* RETURN: */
;('-webkit-user-modify') // in webkit browsers
/* RETURN: */
;('-moz-user-modify') // in firefox browsers

/* camelCase */
console.log(cssPropertyNormalize('user-modify', true))
/* RETURN: */
;('webkitUserModify')

License

MIT

/css-property-normalize/

    Package Sidebar

    Install

    npm i css-property-normalize

    Weekly Downloads

    1

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    8.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • nk12