Skip to content

HTML class names are not processed in an addon #389

@kboucher

Description

@kboucher

I am having trouble converting a few related projects from ember-css-modules to ember-component-css. Specifically, I am unable to get ember-component-css to work with an addon using classic structure or pods structure with a /pods path segment -- which is how the consuming app is configured and I want to avoid changing that if possible.

The ember-component-css docs say:

If you are using classic (non pod) structure, your addon directory structure might look like:

yourAddonDirectory
│   index.js
│   ... etc
└───addon
│   └───components
│       │   yourAddonComponent.js
│   └───templates
│       │   yourAddonComponent.hbs
│   └───styles
│       │   addon.scss (includes the 'pod-styles' import)
│       └───component-styles (this dir name is configurable)
│           │   yourAddonComponent.scss
└───app
    └───components
        │   yourAddonComponent.js

I have followed this exactly (although I think the default classic structure would put the template in the templates/components folder). -- I have tried both.

While I am seeing the generated CSS as expected (with underscores and hash value added), the class name in the markup remain undecorated.

As the documentation suggested, I did add "after": "ember-component-css" to the "ember-addon" block in the addon's package.json file, but that had no effect.

image

Again, according to the documentation I should be able to make this work in an addon using classic structure. Not sure if I'm doing something incorrect, or the documentation needs to be updated.

If there is a way to configure this to work with pods structure in a /pods directory that would also work in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions