Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Getting Started

Alex King edited this page Feb 19, 2018 · 1 revision

Basic Setup

var colors = {
    yellow: '#FDCA21',
    pink: '#FF05FA',

};
var globalSheet = new Fairybread({
    global: true
});
globalSheet.add('body',`background:${colors.yellow}` );
globalSheet.add('h1',`color:${colors.pink}` );
globalSheet.render()

Outputs

<style id="fairybread_208X7mLD6jwR4LCgOzod">
    body { background: #FDCA21; }
    h1 { color:#FF05FA; }
</style>

As you may have guested passing "global" at creation will make a global stylesheet that will effect everything on the page

Clone this wiki locally