Skip to content

Better usage documentation. #31

@colshacol

Description

@colshacol

I am looking for a CSS to JS transpiler tonight and I believe that postcss-js may be what I am looking for. 👍

I've only dabbled in using PostCSS programmatically a few times, so I do not have much common-knowledge in this domain.

Thus, at first glance, I have found myself stumped as to how I will import this tool when I go to use it in a few minutes.

let css  = '@media screen { z-index: 1 }'
let root = postcss.parse(css);

postcssJs.objectify(root) //=> { '@media screen': { zIndex: '1' } }

I am oblivious as to whether I should const postcssJs = require('postcss-js') or const { postcssJs } = require('postcss-js'), etc.

Not a big problem, no. I'll figure it out quickly if a default require fails. Or I could even read the source to see what is exported and how it is exported. Nonetheless, it isn't intuitive just from reading the samples. -- Somebody with less tinkering experience than I may be blocked by this.

(I do believe that your documentation on how to use it is adequate!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions