Skip to content

values in selectors aren't escaped properly. #966

@jquense

Description

@jquense

on latest css-loader. I'd expect this to be true for any defined value but not importing classes where the local ident is generated.

// button.css

.button {

}

// toolbar.css

@value btn from './button.css'

.toolbar > btn {
	color: red
}
rules: [
  { 
  test: /\.css/, 
  use: {
    loader: 'css-loader',
    options: {
		modules: {
			getLocalIdent: (ctx, name) => `${name}.hey`
		}
	}
  }
]

The local names would need escaping and webpack outputs:

.button\.hey {
}

which is correctly escaped but in toolbar its

.toolbar\.hey > .button.hey {
}

note that the interpolated value isn't escaped. I'm not sure why this is happening maybe it needs to be re-escaped?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions