New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coss

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coss

A simple compiler that compiles js to css.

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

COSS

npm install coss

# Or use in browser. Note that only the `coss.min.js` is build for browser.
bower install coss

API

coss

param: source { Object | Array }

The source data to compile.

param: indent { String }

Default is 4 spaces.

return: { String }

The compiled code.

example:

level = ->
	level.count ?= 1
	'.level_' + level.count++

# Compile an array css tree.
# The array compiler can use variable as css selector.
coss [
	['#basic'
		['font-size', '12px']
		['opacity', 0.8]
	]
	[level()
		['background', 'red']
		['border', '1px solid #fff']

		['&:hover'
			['background', 'blue']
		]

		[level()
			['margin', '1px']

			[level()
				['padding', 0]
			]
		]
	]
]

# Compile an object css tree.
coss {
	'.level_1':
		background: 'red'
		border: '1px solid #fff'

		'.level_2':
			margin: '1px'

			'.level_3':
				padding: 0
	'#another':
		'font-size': '12px'
		opacity: 0.8
}

Keywords

FAQs

Package last updated on 15 Oct 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc