S
S
shweps1232015-04-04 12:18:39
css
shweps123, 2015-04-04 12:18:39

How to pass JSON to Stylus?

Hello. I need to pass a JSON config as a set of CSS variables to the Stylus preprocessor. How can I do that? The stylus site mentions the " json() " and " use() " functions, but the "json()" function does not handle nested objects and arrays, and the "use()" function did not work for me at all. Those who faced this task, please throw off a code example. I use NodeJS for compilation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iboozy, 2015-10-15
@iboozy

To handle nested values, you need to pass the second parameter:
$THEME = json($THEME_PATH, {hash: true})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question