Skip to content

krokis/layla-plugin-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Layla JSON plugin

Read JSON files directly from your Layla code.

Installation

Install as a dependency of your project with NPM:

npm install layla-plugin-json --save # or --save-dev

Usage

First require the plugin in your stylesheet:

use 'json'

Now you can call the JSON.read method to read and parse a JSON file and maybe assign the result to a variable:

use 'json'

$config = JSON.read('./config.json')

body {
  if $config::debug {
    color: red
  }
}

The plugin will translate JSON types to Layla objects according to the following table:

JSON type Layla type
null Null
Boolean Boolean
Number Number
String String
Array List
Object Block

License

BSD-like

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published