Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

BEM dashes break output css #244

Closed
Closed

Description

@Galvo87

I am loading css like this

loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')

and when using BEM naming convention with modifiers like menu__subitem--visible there seems to be a problem in generated css style.
Works fine if I rename it to menu__subitem__visible, so I guess it doesn't really like double dashes...
Any help?

Activity

  1. psimyn commented on Apr 18, 2016

    @psimyn

    what goes wrong with the generated styles?

    dashes work fine in either your own classes or localIdentName, only thing I can think of that will break is JS with styles.className notation (which will be syntax error).

    The CSS you get should have transformed class name

  2. silouanwright commented on Apr 6, 2017

    @silouanwright

    @psimyn Wait I'm confused. I normally either have the option of using styleName, or using styles.className notation. I don't have the option of using styleName when it comes to using something like ReactCSSTransition, so I'm using styles.className notation, unless there's some other option.

    I think my issue is that if the camelCase option is ticked off, then it should remove multiple hyphens as well... there's zero use case where someone would turn camelCase on, then not want the double hyphen case translated to camel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions