1.1.3 • Published 7 years ago

sexy-css v1.1.3

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

sexy

JavaScript module that compiles Lisp-style s-expressions to CSS

installation

$ npm install sexy-css -g

usage

$ sexy <path-to-file.sexy> > <output-file.css>

syntax

Example:

(.container :font-size 16px
            :color #0000FF
  (p :color #FF0000
    (span :text-decoration underline
          :border-bottom 1px solid #000000))
  (h1 :font-size 36px))

becomes (prettified)

.container {
  font-size: 16px;
  color: #0000FF;
}

.container p {
  color: #FF0000;
}

.container p span {
  text-decoration: underline;
  border-bottom: 1px solid #000000;
}

.container h1 {
  font-size: 36px;
}

You can also use Sass-style variables:

(let ($red #FF0000
      $blue #0000FF
      $border 1px solid #000000
      $base-font-size 16px
      $heading-font-size 36px)
  (.container :font-size $base-font-size
              :color $blue
    (p :color $red
      (span :text-decoration underline
            :border-bottom $border))
    (h1 :font-size $heading-font-size)))

This produces the same output.

Be advised that more complex CSS features like media queries and keyframe animations are not going to work.

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago