Skip to content

carlos22/absurdhat

Repository files navigation

AbsurdHat

Port of LESSHat to AbsurdJS. It is more like a automatic wrapper around the Javascript based LESSHat mixins.

WARNING: This is a proof-of-concept, for now only hatBackgroundImage (aka .background-image()) is tested!

Usage

Node.js

TODO

Client-Side

<script src="http://absurdjs.com/builds/absurd.js"></script>
<script src="https://rawgithub.com/carlos22/absurdhat/master/build/absurdhat.js"><script>
var absurd = Absurd();

// add hat* plugins
absurdhat(absurd);

// use
absurd.add({
    body: {
        hatBackgroundImage: 'linear-gradient(to bottom, #fb83fa 0%,#e93cec 100%)'
    }
}).compile(function(err, css) {   
    console.clear();
    console.log(css);
});

</script>

Demo

The client side build is generated using browserify. A standalone build named 'absurdhat' is generated. Make sure to use require() if you use requireJs or similar.

Create own Build

The current build only includes hatBackgroundImage. You can easily add more in mixin.json.

TODO

  • Make tests work (should be not too hard)
  • Use include/exclude of mixins instead of hard coded config
  • Mixin Adapter needs to respect results.property

About

LESSHat wrapper scripts to use it with AbsurdJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published