Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.
/ convert-to-css Public archive

Converts JavasScript to a minified CSS string.

License

Notifications You must be signed in to change notification settings

LSVH/convert-to-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

convert-to-css

Converts an object to (minified) css

NPM

createCssRule(obj, prepend = '')

Create a css rule of an object of objects.

const objectToCss = require('convert-to-css');

const input = {
	'.foo': {
		padding: 10,
	},
	bar: {
		margin: '10em',
	},
};

objectToCss.createCssRule(input);
// result: ".foo{padding:10px}bar{margin:10em}"

objectToCss.createCssRule({foo:{}});
// result: ""

createCssClasses(obj)

Create a css class of an object of objects.

const objectToCss = require('convert-to-css');

const input = {
	foo: {
		padding: 10,
	},
	bar: {
		margin: '10em',
	},
};

objectToCss.createCssClasses(input);
// result: ".foo{padding:10px}.bar{margin:10em}"

createCssIdentifiers(obj)

Create a css identifiers of an object of objects.

const objectToCss = require('convert-to-css');

const input = {
	foo: {
		padding: 10,
	},
	bar: {
		margin: '10em',
	},
};

objectToCss.createCssIdentifiers(input);
// result: "#foo{padding:10px}#bar{margin:10em}"

createCssProperties(obj)

Create a css rule properties of an object.

const objectToCss = require('convert-to-css');

const input = {
	padding: 10,
	margin: '10em',
};

objectToCss.createCssProperties(input);
// result: "padding:10px;margin:10em"

License

MIT © LSVH

About

Converts JavasScript to a minified CSS string.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published