mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-10 01:47:03 +03:00
Improved handling of secure message <style> CSS class names
This commit is contained in:
parent
64818025e8
commit
5105f6d4c1
3 changed files with 22 additions and 19 deletions
|
|
@ -27,11 +27,13 @@ export class CSS
|
|||
* Given css array, parses it and then for every selector,
|
||||
* prepends namespace to prevent css collision issues
|
||||
*/
|
||||
css.applyNamespace = (namespace) => css.forEach(obj => {
|
||||
css.applyNamespace = (namespace, prefix) => css.forEach(obj => {
|
||||
if (obj.type === 'media') {
|
||||
obj.subStyles.applyNamespace(namespace);
|
||||
obj.subStyles.applyNamespace(namespace, prefix);
|
||||
} else {
|
||||
obj.selector = obj.selector.split(',').map(selector => namespace + ' ' + selector).join(',');
|
||||
obj.selector = obj.selector.split(',').map(selector =>
|
||||
namespace + ' ' + selector.replace('.', '.'+prefix)
|
||||
).join(',');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue