google / closure-stylesheets

A CSS+ transpiler that lints, optimizes, and I18n-izes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non splitting renaming type

gaetmorin opened this issue · comments

I am trying to emit a CSS renaming map that does not split class names around hyphens (-). The Closure Compiler intrinsic goog.setCssNameMapping() supports this type of map via the BY_WHOLE style.

Using the latest version of the Closure Stylesheets command line (v1.5.0), there is a --output-renaming-map-format CLOSURE_COMPILED_BY_WHOLE option that appends 'BY_WHOLE' as a second argument to setCssNameMapping, but the renamings are otherwise unchanged (using --rename CLOSURE).

My understanding, after looking at the source code, is that this would require new RenamingType values for the --rename option that do not use SplittingSubstitutionMap. For example, CLOSURE_BY_WHOLE (returning a MinimalSubstitutionMap) and DEBUG_BY_WHOLE (returning a SimpleSubstitutionMap).

Am I missing something, is there another way do do this ? It feels like everything is in place between the CSS and JS compilers, except for this single piece ? Do the users of the BY_WHOLE mapping style call Closure Stylesheets as a library instead of the command line ?

Would the change described above be considered acceptable ?