mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 04:13:07 +02:00
upd: partially un-hash CSS class names
intended to allow easier creation of custom CSS modifications. the last 4 chars of class names should be static as long as files don't move, but just in case modifications might prefer to use prefix selectors such as [class^=MkWhatever] instead of .MkWhatever-1234
This commit is contained in:
parent
97d9510ce6
commit
4a4fd70180
1 changed files with 2 additions and 5 deletions
|
@ -83,11 +83,8 @@ export function getConfig(): UserConfig {
|
|||
modules: {
|
||||
generateScopedName(name, filename, _css): string {
|
||||
const id = (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, '');
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return 'x' + toBase62(hash(id)).substring(0, 4);
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
const shortId = id.replace(/^(components(-global)?|widgets|ui(-_common_)?)-/, '');
|
||||
return shortId + '-' + toBase62(hash(id)).substring(0, 4);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue