ccss CoffeeScript CSS

程序名称:ccss

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

ccss 介绍

CoffeeScript CSS 这个名字跟 CoffeeScript
无关,将脚本化的样式变成 CSS 代码

install: npm install ccss

main.coffee:

ccss = require 'ccss'

template = require './template.coffee'
css = ccss.compile template
require('fs').writeFileSync 'main.css', css

#or all at once: ccss.compileFile './template.coffee', 'main.css'

template.coffee:

borderRadius = (str) ->
  WebkitBorderRadius: str
  MozBorderRadius:    str
  borderRadius:       str

BoxShadow = (str) ->
  WebkitBoxShadow: str
  MozBoxShadow:    str
  BoxShadow:       str

module.exports =
  form:
    input:
      padding: '5px'
      border: '1px solid'
      mixins: borderRadius '5px'
  '#id .className': do ->
    opaque = 1
    translucent = opaque / 2
    img:
      mixins: [
        borderRadius '5px'
        BoxShadow '5px'
      ]
      opacity: translucent
    'img:hover':
      opacity: opaque

main.css:

form input {
  padding: 5px;
  border: 1px solid;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}
#id .className img {
  opacity: 0.5;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  -webkit-Box-shadow: 5px;
  -moz-Box-shadow: 5px;
  Box-shadow: 5px;
}
#id .className img:hover {
  opacity: 1;
}

ccss 官网

https://github.com/aeosynth/ccss

相关编程语言

MuPlayer 是一款跨平台、轻量级的音频播放解决方案,...
OS FLV 是一个 开源和可嵌入网页的flv播放器。 这个...
DewPlayer音乐播放器,样式很简单,而且很实用.播放器...
JW FLV MEDIA PLAYER是一个开源的在网页上使用的Fla...
Speakker 是一个基于 Web 浏览器的音乐播放器,只提...
Player Framework 是一个开源的支持 HTML5 的视频播...