css-selector-rename
v1.0.1
Published
A CSS tool to rename css selector
Downloads
39
Readme
css-selector-rename
CSS 选择器重命名
usage
import cssSelectorRename from 'css-selector-rename';
const output = cssSelectorRename(input, options);
.foo {
}
div {
}
.rename-foo {
}
rename-div {
}
Options
default options
{
test: (name) => true,
selector: {
classes: false,
ids: false,
tags: false,
},
rename: (name, type) => name
}
test?: (name: string) => boolean
|RegExp
only rename when return trueselector?: Partial<Record<'classes' | 'tags' | 'ids', boolean>>
walk selector typerename: (name: string, type: 'classes' | 'tags' | 'ids') => string
return new selector name