Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

How to disable token camelCase in HTML output #188

@withinsight

Description

@withinsight

The default for token names in the html output is camelCase. I should be able to override this by setting up a setup.js file, and defining a custom formatOption.

I currently see this error:

Error: No options? at transform.chain.fold.e (/Users/{un}/{project}/node_modules/theo/lib/index.js:122:32)

Here's my setup.js:

module.exports = theo => {
  let formatOptions = {
    type: 'html',
    options: {
      transformPropName: name => name
    }
  }

  theo.convert(formatOptions).then((result) => {
    console.log(result);
  }).catch((result) => {
    console.log(result);
  });
}

As you can see I'm simply returning the token name, so it should remain unchanged.

I'm using the CLI:

theo src/lib/tokens/tokens.yml --format html --dest src/lib/tokens --setup src/lib/tokens/setup.js

How can I disable the camelCase formatting for our tokens when displayed in HTML output?

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